]> git.ipfire.org Git - thirdparty/git.git/commit
fsck tests: refactor one test to use a sub-repo
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Fri, 1 Oct 2021 09:16:38 +0000 (11:16 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 1 Oct 2021 22:05:59 +0000 (15:05 -0700)
commitf7a0dba7a25ec600e2c9e8d98ecabf8d3d97f6ed
tree000d14cedf2bf4b38fb58e6dc0bb924898326b24
parent093fffdfbec4ce3fee9a5cebde0aae87bcebb0cc
fsck tests: refactor one test to use a sub-repo

Refactor one of the fsck tests to use a throwaway repository. It's a
pervasive pattern in t1450-fsck.sh to spend a lot of effort on the
teardown of a tests so we're not leaving corrupt content for the next
test.

We can instead use the pattern of creating a named sub-repository,
then we don't have to worry about cleaning up after ourselves, nobody
will care what state the broken "hash-mismatch" repository is after
this test runs.

See [1] for related discussion on various "modern" test patterns that
can be used to avoid verbosity and increase reliability.

1. https://lore.kernel.org/git/87y27veeyj.fsf@evledraar.gmail.com/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1450-fsck.sh