]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t2021: fix platform-specific leftover cruft
authorElijah Newren <newren@gmail.com>
Mon, 27 Feb 2023 15:28:08 +0000 (15:28 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 27 Feb 2023 16:29:50 +0000 (08:29 -0800)
t2021.6 existed to test the status of a symlink that was left around by
previous tests.  It tried to also clean up the symlink after it was done
so that subsequent tests wouldn't be tripped up by it.  Unfortunately,
since this test had a SYMLINK prerequisite, that made the cleanup
platform dependent...and made a testcase I was trying to add to this
testsuite fail (that testcase will be included in the next patch).
Before we go and add new testcases, fix this cleanup by moving it into a
separate test.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t2021-checkout-overwrite.sh

index 713c3fa6038632bff43ef8344be2d4a6a73cb32e..baca66e1a31867eb97175758573cd0666e8f83ff 100755 (executable)
@@ -50,10 +50,13 @@ test_expect_success 'checkout commit with dir must not remove untracked a/b' '
 
 test_expect_success SYMLINKS 'the symlink remained' '
 
-       test_when_finished "rm a/b" &&
        test -h a/b
 '
 
+test_expect_success 'cleanup after previous symlink tests' '
+       rm a/b
+'
+
 test_expect_success SYMLINKS 'checkout -f must not follow symlinks when removing entries' '
        git checkout -f start &&
        mkdir dir &&