diff options
author | Jeff King <peff@peff.net> | 2017-07-07 11:08:30 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-07-09 19:00:48 +0200 |
commit | 7f97de5ee1e1f9d28f45c8f7890e752f7b12bed1 (patch) | |
tree | eaeecf98f49cf177a3df093f70ea287da6521b31 /t/t1414-reflog-walk.sh | |
parent | get_revision_1(): replace do-while with an early return (diff) | |
download | git-7f97de5ee1e1f9d28f45c8f7890e752f7b12bed1.tar.xz git-7f97de5ee1e1f9d28f45c8f7890e752f7b12bed1.zip |
rev-list: check reflog_info before showing usage
When git-rev-list sees no pending commits, it shows a usage
message. This works even when reflog-walking is requested,
because the reflog-walk code currently puts the reflog tips
into the pending queue.
In preparation for refactoring the reflog-walk code, let's
explicitly check whether we have any reflogs to walk. For
now this is a noop, but the existing reflog tests will make
sure that it kicks in after the refactoring. Likewise, we'll
add a test that "rev-list -g" without specifying any reflogs
continues to fail (so that we know our check does not kick
in too aggressively).
Note that the implementation needs to go into its own
sub-function, as the walk code does not expose its innards
outside of reflog-walk.c.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1414-reflog-walk.sh')
-rwxr-xr-x | t/t1414-reflog-walk.sh | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/t/t1414-reflog-walk.sh b/t/t1414-reflog-walk.sh index 945aa089ec..8bda862ca7 100755 --- a/t/t1414-reflog-walk.sh +++ b/t/t1414-reflog-walk.sh @@ -102,4 +102,8 @@ test_expect_failure 'walk prefers reflog to ref tip' ' test_cmp expect actual ' +test_expect_success 'rev-list -g complains when there are no reflogs' ' + test_must_fail git rev-list -g +' + test_done |