From 93e911f5ae0b262fc63898790ab40f2306fd5395 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Thu, 19 Nov 2015 20:09:47 +0100 Subject: [PATCH] modernize t9300: use test_when_finished for clean-up A number of clean-ups of test cases are performed outside of test_expect_success. Replace these cases by using test_when_finished. Signed-off-by: Johannes Sixt Signed-off-by: Jeff King --- t/t9300-fast-import.sh | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh index c36afdb8ff..adabd687d8 100755 --- a/t/t9300-fast-import.sh +++ b/t/t9300-fast-import.sh @@ -344,9 +344,9 @@ M 755 0000000000000000000000000000000000000001 zero1 INPUT_END test_expect_success 'B: fail on invalid blob sha1' ' + test_when_finished "rm -f .git/objects/pack_* .git/objects/index_*" && test_must_fail git fast-import input </dev/null >/dev/null -git prune 2>/dev/null >/dev/null cat >input </dev/null >/dev/null -git prune 2>/dev/null >/dev/null cat >input </dev/null >/dev/null -git prune 2>/dev/null >/dev/null cat >input <input <input <input <input <tmp && cat tmp | cut -f 2 >actual && @@ -921,8 +919,6 @@ test_expect_success 'L: nested tree copy does not corrupt deltas' ' git fsck `git rev-parse L2` ' -git update-ref -d refs/heads/L2 - ### ### series M ###