Skip to content

Commit ef1cc2c

Browse files
author
Junio C Hamano
committed
rev-list --objects: fix object list without commit.
Earlier, "rev-list --objects <sha1>" for an object chain that does not have any commit failed with a usage message. This fixes "send-pack remote $tag" where tag points at a non-commit (e.g. a blob). Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 42f4570 commit ef1cc2c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rev-list.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,8 @@ int main(int argc, const char **argv)
850850
handle_one_commit(commit, &list);
851851
}
852852

853-
if (!list)
853+
if (!list &&
854+
(!(tag_objects||tree_objects||blob_objects) && !pending_objects))
854855
usage(rev_list_usage);
855856

856857
paths = get_pathspec(prefix, argv + i);

0 commit comments

Comments
 (0)