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 "$(git config --bool core.filemode)" = false
&&
20 say
"executable bit not honored - skipping" &&
24 test_expect_success
'same mode (no index)' '
27 git apply patch-0.txt &&
31 test_expect_success
'same mode (with index)' '
35 git apply --index patch-0.txt &&
40 test_expect_success
'same mode (index only)' '
44 git apply --cached patch-0.txt &&
45 git ls-files -s file | grep "^100755"
48 test_expect_success
'mode update (no index)' '
50 git apply patch-1.txt &&
54 test_expect_success
'mode update (with index)' '
56 git apply --index patch-1.txt &&
61 test_expect_success
'mode update (index only)' '
63 git apply --cached patch-1.txt &&
64 git ls-files -s file | grep "^100755"