| # Copyright (c) 2005 Junio C Hamano |
| test_description='git-apply handling copy/rename patch. |
| test_expect_success setup \ |
| 'git-update-index --add foo' |
| test_expect_success apply \ |
| 'git-apply --index --stat --summary --apply test-patch' |
| if [ "$(git repo-config --get core.filemode)" = false ] |
| say 'filemode disabled on the filesystem' |
| test_expect_success validate \ |
| 'test -f bar && ls -l bar | grep "^-..x......"' |
| test_expect_success 'apply reverse' \ |
| 'git-apply -R --index --stat --summary --apply test-patch && |
| test "$(cat foo)" = "This is foo"' |
| test_expect_success 'apply copy' \ |
| 'git-apply --index --stat --summary --apply test-patch && |
| test "$(cat bar)" = "This is bar" -a "$(cat foo)" = "This is foo"' |