Skip to content

Commit 230356b

Browse files
hanwengitster
authored andcommitted
t4202: split testcase for invalid HEAD symref and HEAD hash
Reftable will prohibit invalid hashes at the storage level, but git-symbolic-ref can still create branches ending in ".lock". Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 54a3917 commit 230356b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

t/t4202-log.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1834,14 +1834,18 @@ test_expect_success 'log --graph --no-walk is forbidden' '
18341834
test_must_fail git log --graph --no-walk
18351835
'
18361836

1837-
test_expect_success 'log diagnoses bogus HEAD' '
1837+
test_expect_success 'log diagnoses bogus HEAD hash' '
18381838
git init empty &&
1839+
test_when_finished "rm -rf empty" &&
18391840
test_must_fail git -C empty log 2>stderr &&
18401841
test_i18ngrep does.not.have.any.commits stderr &&
18411842
echo 1234abcd >empty/.git/refs/heads/main &&
18421843
test_must_fail git -C empty log 2>stderr &&
1843-
test_i18ngrep broken stderr &&
1844-
echo "ref: refs/heads/invalid.lock" >empty/.git/HEAD &&
1844+
test_i18ngrep broken stderr'
1845+
1846+
test_expect_success 'log diagnoses bogus HEAD symref' '
1847+
git init empty &&
1848+
git --git-dir empty/.git symbolic-ref HEAD refs/heads/invalid.lock &&
18451849
test_must_fail git -C empty log 2>stderr &&
18461850
test_i18ngrep broken stderr &&
18471851
test_must_fail git -C empty log --default totally-bogus 2>stderr &&

0 commit comments

Comments
 (0)