t3700: fix broken test under !POSIXPERM
PATCH 1/1 t3700: fix broken test under !POSIXPERM
76e368c378 (t3700: fix broken test under !SANITY) explains that the test 'git add --chmod=[+-]x changes index with already added file' can fail if xfoo3 is still present as a symlink from a previous test and deletes it with rm(1). That still leaves it present in the index, which causes the test to fail if POSIXPERM is not defined. Get rid of it by calling "git reset --hard" instead, as 76e368c378 already mentioned in passing.
--- t/t3700-add.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
t/t3700-add.sh +1 -1
@@ -355,7 +355,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 && + git reset --hard && echo foo >foo3 && git add foo3 && git add --chmod=+x foo3 &&
Signature · 1 line
2.14.0
PATCH v2 1/1 t3700: fix broken test under !POSIXPERM
76e368c378 (t3700: fix broken test under !SANITY) explains that the test 'git add --chmod=[+-]x changes index with already added file' can fail if xfoo3 is still present as a symlink from a previous test and deletes it with rm(1). That still leaves it present in the index, which causes the test to fail if POSIXPERM is not defined. Get rid of it by calling "git reset --hard" as well, as 76e368c378 already mentioned in passing.
---
Change since v1: Keep the rm(1) call to avoid a problem on Cygwin.
t/t3700-add.sh | 1 + 1 file changed, 1 insertion(+)
t/t3700-add.sh +1 -0
@@ -356,6 +356,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 && + git reset --hard && echo foo >foo3 && git add foo3 && git add --chmod=+x foo3 &&
Signature · 1 line
2.14.0
Quoted 6 lines · René Scharfe
76e368c378(t3700: fix broken test under !SANITY) explains that the test 'git add --chmod=[+-]x changes index with already added file' can fail if xfoo3 is still present as a symlink from a previous test and deletes it with rm(1). That still leaves it present in the index, which causes the test to fail if POSIXPERM is not defined. Get rid of it by calling "git reset --hard" as well, as76e368c378already mentioned in passing.
Hmm, I don't think its POSIXPERM (which is defined on cygwin) but the lack of SANITY that is the problem. The test would fail on Linux as well, if it skipped the prior tests marked with SANITY (they get rid of the xfoo3->xfoo2 symlinks, among others).
Ack, this fixes it for me.
ATB,
Ramsay Jones
Quoted 22 lines
Helped-by Adam Dinwoodie <[email protected]>Signed-off-by Rene Scharfe <[email protected]>---
Change since v1: Keep the rm(1) call to avoid a problem on Cygwin.t/t3700-add.sh | 1 + 1 file changed, 1 insertion(+)t/t3700-add.sh +1
-0@@ -356,6 +356,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 && + git reset --hard && echo foo >foo3 && git add foo3 && git add --chmod=+x foo3 &&
Quoted 10 lines · Ramsay Jones
Quoted 6 lines · René Scharfe
76e368c378(t3700: fix broken test under !SANITY) explains that the test 'git add --chmod=[+-]x changes index with already added file' can fail if xfoo3 is still present as a symlink from a previous test and deletes it with rm(1). That still leaves it present in the index, which causes the test to fail if POSIXPERM is not defined. Get rid of it by calling "git reset --hard" as well, as76e368c378already mentioned in passing.
Quoted 4 lines
Hmm, I don't think its POSIXPERM (which is defined on cygwin) but the lack of SANITY that is the problem. The test would fail on Linux as well, if it skipped the prior tests marked with SANITY (they get rid of the
xfoo3->xfoo2symlinks, among others).
Yep, I didn't read the commit message properly! ;-)
Quoted 29 lines
Ack, this fixes it for me.
ATB,
Ramsay JonesQuoted 22 lines
Helped-by Adam Dinwoodie <[email protected]>Signed-off-by Rene Scharfe <[email protected]>---
Change since v1: Keep the rm(1) call to avoid a problem on Cygwin.t/t3700-add.sh | 1 + 1 file changed, 1 insertion(+)t/t3700-add.sh +1
-0@@ -356,6 +356,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 && + git reset --hard && echo foo >foo3 && git add foo3 && git add --chmod=+x foo3 &&