]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t4202: mark bogus head hash test with REFFILES
authorHan-Wen Nienhuys <hanwen@google.com>
Mon, 31 May 2021 16:56:36 +0000 (16:56 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 2 Jun 2021 01:01:55 +0000 (10:01 +0900)
In reftable, hashes are correctly formed by design.

Split off test for git-log in empty repo.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Reviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t4202-log.sh

index 327991fcea49532cef879e75b3082735a429b9cd..39e746fbcbe228b7d81678859cc8f549e06f2927 100755 (executable)
@@ -1834,14 +1834,20 @@ test_expect_success 'log --graph --no-walk is forbidden' '
        test_must_fail git log --graph --no-walk
 '
 
-test_expect_success 'log diagnoses bogus HEAD hash' '
+test_expect_success 'log on empty repo fails' '
        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 &&
+       test_i18ngrep 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_i18ngrep broken stderr'
+       test_i18ngrep broken stderr
+'
 
 test_expect_success 'log diagnoses bogus HEAD symref' '
        git init empty &&