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>
Junio C Hamano committed
Dec 19, 2005 at 16:16 UTC
ef1cc2cc216b37c33f1f5d68e770404c435fe1f3
1 file changed
+2
-1
rev-list.c
+2
-1
@@ -850,7 +850,8 @@ int main(int argc, const char **argv)
850
handle_one_commit(commit, &list);
851
}
852
853
- if (!list)
853
+ if (!list &&
854
+ (!(tag_objects||tree_objects||blob_objects) && !pending_objects))
855
usage(rev_list_usage);
856
857
paths = get_pathspec(prefix, argv + i);