path: root/t/
diff options
authorHan-Wen Nienhuys <>2021-05-31 16:56:16 (GMT)
committerJunio C Hamano <>2021-06-02 01:01:54 (GMT)
commit230356ba704fc36e848e94b13c5b92acfa4c6fc6 (patch)
tree1c4a652991652c21b7c25f6617d2c80d55004bf5 /t/
parent54a391711554ed41b4b0792cfef004abc74893bd (diff)
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 <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 't/')
1 files changed, 7 insertions, 3 deletions
diff --git a/t/ b/t/
index 350cfa3..327991f 100755
--- a/t/
+++ b/t/
@@ -1834,14 +1834,18 @@ test_expect_success 'log --graph --no-walk is forbidden' '
test_must_fail git log --graph --no-walk
-test_expect_success 'log diagnoses bogus HEAD' '
+test_expect_success 'log diagnoses bogus HEAD hash' '
git init empty &&
+ test_when_finished "rm -rf empty" &&
test_must_fail git -C empty log 2>stderr &&
test_i18ngrep does.not.have.any.commits stderr &&
echo 1234abcd >empty/.git/refs/heads/main &&
test_must_fail git -C empty log 2>stderr &&
- test_i18ngrep broken stderr &&
- echo "ref: refs/heads/invalid.lock" >empty/.git/HEAD &&
+ test_i18ngrep broken stderr'
+test_expect_success 'log diagnoses bogus HEAD symref' '
+ git init empty &&
+ git --git-dir empty/.git symbolic-ref HEAD refs/heads/invalid.lock &&
test_must_fail git -C empty log 2>stderr &&
test_i18ngrep broken stderr &&
test_must_fail git -C empty log --default totally-bogus 2>stderr &&