Skip to content

Commit

Permalink
t4202: move reffiles specific tests to t0600
Browse files Browse the repository at this point in the history
Move two tests into t0600 since they write loose reflog refs manually
and thus are specific to the reffiles backend.

Signed-off-by: John Cai <[email protected]>
  • Loading branch information
john-cai committed Jan 18, 2024
1 parent 98b5342 commit b5a986c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
17 changes: 17 additions & 0 deletions t/t0600-reffiles-backend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -560,4 +560,21 @@ test_expect_success 'drop stash reflog updates refs/stash with rewrite' '
test_cmp expect actual
'

test_expect_success 'log diagnoses bogus HEAD hash' '
git init empty &&
test_when_finished "rm -rf empty" &&
echo 1234abcd >empty/.git/refs/heads/main &&
test_must_fail git -C empty log 2>stderr &&
test_grep broken stderr
'

test_expect_success 'log diagnoses bogus HEAD symref' '
git init empty &&
test-tool -C empty ref-store main create-symref HEAD refs/heads/invalid.lock &&
test_must_fail git -C empty log 2>stderr &&
test_grep broken stderr &&
test_must_fail git -C empty log --default totally-bogus 2>stderr &&
test_grep broken stderr
'

test_done
17 changes: 0 additions & 17 deletions t/t4202-log.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2255,23 +2255,6 @@ test_expect_success 'log on empty repo fails' '
test_grep does.not.have.any.commits stderr
'

test_expect_success REFFILES 'log diagnoses bogus HEAD hash' '
git init empty &&
test_when_finished "rm -rf empty" &&
echo 1234abcd >empty/.git/refs/heads/main &&
test_must_fail git -C empty log 2>stderr &&
test_grep broken stderr
'

test_expect_success REFFILES 'log diagnoses bogus HEAD symref' '
git init empty &&
test-tool -C empty ref-store main create-symref HEAD refs/heads/invalid.lock &&
test_must_fail git -C empty log 2>stderr &&
test_grep broken stderr &&
test_must_fail git -C empty log --default totally-bogus 2>stderr &&
test_grep broken stderr
'

test_expect_success 'log does not default to HEAD when rev input is given' '
git log --branches=does-not-exist >actual &&
test_must_be_empty actual
Expand Down

0 comments on commit b5a986c

Please sign in to comment.