rev-list: don't show usage when we see empty ref patterns

If the user gives us no starting point for a traversal, we
want to complain with our normal usage message. But if they
tried to do so with "--all" or "--glob", but that happened
not to match any refs, the usage message isn't helpful. We
should just give them the empty output they asked for
instead.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jeff King
2017-08-02 18:26:06 -04:00
committed by Junio C Hamano
parent 7ba826290a
commit 0159ba3226
2 changed files with 5 additions and 4 deletions

View File

@ -350,7 +350,8 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
if ((!revs.commits &&
(!(revs.tag_objects || revs.tree_objects || revs.blob_objects) &&
!revs.pending.nr)) ||
!revs.pending.nr) &&
!revs.rev_input_given) ||
revs.diff)
usage(rev_list_usage);