]> granicus.if.org Git - git/commitdiff
index-pack tests: don't leave test repo dirty at end
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Tue, 30 Oct 2018 18:43:31 +0000 (18:43 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 31 Oct 2018 02:12:05 +0000 (11:12 +0900)
Change a test added in 51054177b3 ("index-pack: detect local
corruption in collision check", 2017-04-01) so that the repository
isn't left dirty at the end.

Due to the caveats explained in 720dae5a19 ("config doc: elaborate on
fetch.fsckObjects security", 2018-07-27) even a "fetch" that fails
will write to the local object store, so let's copy the bit-error test
directory before running this test.

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

index ac1f189fd29b171c16af17e1d3ddda48f557df89..4feb65157d87e803a6cd2caf6cec2a945f54b085 100755 (executable)
@@ -117,8 +117,10 @@ test_expect_failure 'clone --local detects misnamed objects' '
 '
 
 test_expect_success 'fetch into corrupted repo with index-pack' '
+       cp -R bit-error bit-error-cp &&
+       test_when_finished "rm -rf bit-error-cp" &&
        (
-               cd bit-error &&
+               cd bit-error-cp &&
                test_must_fail git -c transfer.unpackLimit=1 \
                        fetch ../no-bit-error 2>stderr &&
                test_i18ngrep ! -i collision stderr