| test_description='applying patch with mode bits' |
| test_expect_success setup ' |
| git diff --stat -p >patch-0.txt && |
| git diff --stat -p >patch-1.txt |
| test_expect_success FILEMODE 'same mode (no index)' ' |
| test_expect_success FILEMODE 'same mode (with index)' ' |
| git apply --index patch-0.txt && |
| test_expect_success FILEMODE 'same mode (index only)' ' |
| git apply --cached patch-0.txt && |
| git ls-files -s file | grep "^100755" |
| test_expect_success FILEMODE 'mode update (no index)' ' |
| test_expect_success FILEMODE 'mode update (with index)' ' |
| git apply --index patch-1.txt && |
| test_expect_success FILEMODE 'mode update (index only)' ' |
| git apply --cached patch-1.txt && |
| git ls-files -s file | grep "^100755" |