]>
Commit | Line | Data |
---|---|---|
35cc4bcd JS |
1 | #!/bin/sh |
2 | # | |
3 | # Copyright (c) 2005 Junio C Hamano | |
4 | # | |
5 | ||
6 | test_description='git-apply handling copy/rename patch. | |
7 | ||
8 | ' | |
9 | . ./test-lib.sh | |
10 | ||
11 | # setup | |
12 | ||
13 | cat >test-patch <<\EOF | |
14 | diff --git a/foo b/bar | |
15 | similarity index 47% | |
16 | copy from foo | |
17 | copy to bar | |
18 | --- a/foo | |
19 | +++ b/bar | |
20 | @@ -1 +1 @@ | |
21 | -This is foo | |
22 | +This is bar | |
23 | EOF | |
24 | ||
25 | echo 'This is foo' >foo | |
26 | chmod +x foo | |
27 | ||
28 | test_expect_success setup \ | |
215a7ad1 | 29 | 'git-update-index --add foo' |
35cc4bcd JS |
30 | |
31 | test_expect_success apply \ | |
32 | 'git-apply --index --stat --summary --apply test-patch' | |
33 | ||
b484ef28 AR |
34 | if [ "$(git repo-config --get core.filemode)" = false ] |
35 | then | |
36 | say 'filemode disabled on the filesystem' | |
37 | else | |
38 | test_expect_success validate \ | |
39 | 'test -f bar && ls -l bar | grep "^-..x......"' | |
40 | fi | |
35cc4bcd JS |
41 | |
42 | test_done |