3 # Copyright (c) 2005 Junio C Hamano
6 test_description='git apply handling copy/rename patch.
13 cat >test-patch <<\EOF
14 diff --git a/foo b/bar
25 echo 'This is foo' >foo
28 test_expect_success setup \
29 'git update-index --add foo'
31 test_expect_success apply \
32 'git apply --index --stat --summary --apply test-patch'
34 test_expect_success FILEMODE validate \
35 'test -f bar && ls -l bar | grep "^-..x......"'
37 test_expect_success 'apply reverse' \
38 'git apply -R --index --stat --summary --apply test-patch &&
39 test "$(cat foo)" = "This is foo"'
41 cat >test-patch <<\EOF
42 diff --git a/foo b/bar
53 test_expect_success 'apply copy' \
54 'git apply --index --stat --summary --apply test-patch &&
55 test "$(cat bar)" = "This is bar" && test "$(cat foo)" = "This is foo"'