summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-10-10 10:41:51 -0700
committerJunio C Hamano <gitster@pobox.com>2016-10-20 09:19:05 -0700
commit76e368c3780810b02b91d07254762d10f20f5ed6 (patch)
treee8c637e3e9270dc2d854e9e2ca5580ba7706b8d9
parent40e0dc17ce6f8b699c0f9426438362ed658293dc (diff)
downloadgit-76e368c3780810b02b91d07254762d10f20f5ed6.tar.gz
t3700: fix broken test under !SANITYtg/add-chmod+x-fix
An "add --chmod=+x" test recently added by 610d55af0f ("add: modify already added files when --chmod is given", 2016-09-14) used "xfoo3" as a test file. The paths xfoo[1-3] were used by earlier tests for symbolic links but they were expected to have been removed by the time the execution reached this new test. The removal with "git reset --hard" however happened in a pair of earlier tests, both of which are protected by POSIXPERM,SANITY prerequisites. Platforms and test environments that lacked these would have seen xfoo3 as a leftover symbolic link that points at somewhere else at this point of the sequence, and the chmod test would have given a wrong result. Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xt/t3700-add.sh1
1 files changed, 1 insertions, 0 deletions
diff --git a/t/t3700-add.sh b/t/t3700-add.sh
index 924a266126..53c0cb6dea 100755
--- a/t/t3700-add.sh
+++ b/t/t3700-add.sh
@@ -350,6 +350,7 @@ test_expect_success POSIXPERM,SYMLINKS 'git add --chmod=+x with symlinks' '
'
test_expect_success 'git add --chmod=[+-]x changes index with already added file' '
+ rm -f foo3 xfoo3 &&
echo foo >foo3 &&
git add foo3 &&
git add --chmod=+x foo3 &&