diff options
-rw-r--r-- | builtin/rev-list.c | 3 | ||||
-rwxr-xr-x | t/t6018-rev-list-glob.sh | 6 |
2 files changed, 5 insertions, 4 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); diff --git a/t/t6018-rev-list-glob.sh b/t/t6018-rev-list-glob.sh index f8367b829c..d3453c583c 100755 --- a/t/t6018-rev-list-glob.sh +++ b/t/t6018-rev-list-glob.sh @@ -261,13 +261,13 @@ test_expect_failure 'rev-list should succeed with empty output on empty stdin' ' test_cmp expect actual ' -test_expect_failure 'rev-list should succeed with empty output with all refs excluded' ' +test_expect_success 'rev-list should succeed with empty output with all refs excluded' ' >expect && git rev-list --exclude=* --all >actual && test_cmp expect actual ' -test_expect_failure 'rev-list should succeed with empty output with empty --all' ' +test_expect_success 'rev-list should succeed with empty output with empty --all' ' ( test_create_repo empty && cd empty && @@ -277,7 +277,7 @@ test_expect_failure 'rev-list should succeed with empty output with empty --all' ) ' -test_expect_failure 'rev-list should succeed with empty output with empty glob' ' +test_expect_success 'rev-list should succeed with empty output with empty glob' ' >expect && git rev-list --glob=does-not-match-anything >actual && test_cmp expect actual |