3 test_description
='applying patch with mode bits'
7 test_expect_success setup
'
11 git commit -m initial &&
13 echo modified >file &&
14 git diff --stat -p >patch-0.txt &&
16 git diff --stat -p >patch-1.txt
19 test_expect_success FILEMODE
'same mode (no index)' '
22 git apply patch-0.txt &&
26 test_expect_success FILEMODE
'same mode (with index)' '
30 git apply --index patch-0.txt &&
35 test_expect_success FILEMODE
'same mode (index only)' '
39 git apply --cached patch-0.txt &&
40 git ls-files -s file | grep "^100755"
43 test_expect_success FILEMODE
'mode update (no index)' '
45 git apply patch-1.txt &&
49 test_expect_success FILEMODE
'mode update (with index)' '
51 git apply --index patch-1.txt &&
56 test_expect_success FILEMODE
'mode update (index only)' '
58 git apply --cached patch-1.txt &&
59 git ls-files -s file | grep "^100755"