@matheusbsbs / matheus-bagliano / commits / 97a853d34b
Fork 0

t4120-apply-popt: help systems with core.filemode=false

A test case verifies that filemode-only patches work as expected. Help systems where "test -x" does not work by applying the test patch also to the index, where the effects can be verified even on such systems. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Sixt committed Feb 3, 2011 at 15:31 UTC 97a853d34baef41f6d235ba49bf390d063fbd9df
1 file changed +7 -2
t/t4120-apply-popt.sh
+7 -2
@@ -6,6 +6,7 @@
6 test_description='git apply -p handling.'
7
8 . ./test-lib.sh
9 +. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
10
11 test_expect_success setup '
12 mkdir sub &&
@@ -62,8 +63,12 @@ test_expect_success 'apply (-p2) diff, mode change only' '
63 old mode 100644
64 new mode 100755
65 EOF
65 - chmod 644 file1 &&
66 - git apply -p2 patch.chmod &&
66 + test_chmod -x file1 &&
67 + git apply --index -p2 patch.chmod &&
68 + case $(git ls-files -s file1) in 100755*) : good;; *) false;; esac
69 +'
70 +
71 +test_expect_success FILEMODE 'file mode was changed' '
72 test -x file1
73 '
74