3 test_description
='applying patch with mode bits'
6 .
"$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
8 test_expect_success setup
'
12 git commit -m initial &&
14 echo modified >file &&
15 git diff --stat -p >patch-0.txt &&
17 git diff --stat -p >patch-1.txt
20 test_expect_success FILEMODE
'same mode (no index)' '
23 git apply patch-0.txt &&
27 test_expect_success FILEMODE
'same mode (with index)' '
31 git apply --index patch-0.txt &&
36 test_expect_success FILEMODE
'same mode (index only)' '
40 git apply --cached patch-0.txt &&
41 git ls-files -s file | grep "^100755"
44 test_expect_success FILEMODE
'mode update (no index)' '
46 git apply patch-1.txt &&
50 test_expect_success FILEMODE
'mode update (with index)' '
52 git apply --index patch-1.txt &&
57 test_expect_success FILEMODE
'mode update (index only)' '
59 git apply --cached patch-1.txt &&
60 git ls-files -s file | grep "^100755"