]>
Commit | Line | Data |
---|---|---|
2c71810b JH |
1 | #!/bin/sh |
2 | # | |
3 | # Copyright (c) 2005 Junio C Hamano | |
4 | # | |
5 | ||
5be60078 | 6 | test_description='git apply symlinks and partial files |
2c71810b JH |
7 | |
8 | ' | |
9 | ||
10 | . ./test-lib.sh | |
11 | ||
704a3143 JS |
12 | if ! test_have_prereq SYMLINKS |
13 | then | |
fadb5156 | 14 | skip_all='Symbolic links not supported, skipping tests.' |
704a3143 | 15 | test_done |
704a3143 JS |
16 | fi |
17 | ||
2c71810b JH |
18 | test_expect_success setup ' |
19 | ||
20 | ln -s path1/path2/path3/path4/path5 link1 && | |
21 | git add link? && | |
22 | git commit -m initial && | |
23 | ||
24 | git branch side && | |
25 | ||
26 | rm -f link? && | |
27 | ||
28 | ln -s htap6 link1 && | |
29 | git update-index link? && | |
30 | git commit -m second && | |
31 | ||
32 | git diff-tree -p HEAD^ HEAD >patch && | |
33 | git apply --stat --summary patch | |
34 | ||
35 | ' | |
36 | ||
37 | test_expect_success 'apply symlink patch' ' | |
38 | ||
39 | git checkout side && | |
40 | git apply patch && | |
41 | git diff-files -p >patched && | |
3af82863 | 42 | test_cmp patch patched |
2c71810b JH |
43 | |
44 | ' | |
45 | ||
46 | test_expect_success 'apply --index symlink patch' ' | |
47 | ||
48 | git checkout -f side && | |
49 | git apply --index patch && | |
50 | git diff-index --cached -p HEAD >patched && | |
3af82863 | 51 | test_cmp patch patched |
2c71810b JH |
52 | |
53 | ' | |
54 | ||
55 | test_done |