Skip to content

Commit

Permalink
rev-list --objects: fix object list without commit.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Dec 20, 2005
1 parent 42f4570 commit ef1cc2c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rev-list.c
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,8 @@ int main(int argc, const char **argv)
handle_one_commit(commit, &list);
}

if (!list)
if (!list &&
(!(tag_objects||tree_objects||blob_objects) && !pending_objects))
usage(rev_list_usage);

paths = get_pathspec(prefix, argv + i);
Expand Down

0 comments on commit ef1cc2c

Please sign in to comment.