diff options
author | Jeff King <peff@peff.net> | 2017-08-03 01:26:06 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-08-03 01:45:21 +0300 |
commit | 0159ba3226f75fbd6d3dc0e92c325cb11f2f0699 (patch) | |
tree | 0aade2ac8ee74994b1c4b3087d0eadda5fc9f7cd /builtin/rev-list.c | |
parent | 7ba826290aa448bb9d0d45c3bb4b34905b741013 (diff) |
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>
Diffstat (limited to 'builtin/rev-list.c')
-rw-r--r-- | builtin/rev-list.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/rev-list.c b/builtin/rev-list.c index 95d84d5cda..1e9cc59488 100644 --- a/builtin/rev-list.c +++ b/builtin/rev-list.c @@ -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); |