Code

Merge branch 'ef/fast-export'
[git.git] / t / t4115-apply-symlink.sh
1 #!/bin/sh
2 #
3 # Copyright (c) 2005 Junio C Hamano
4 #
6 test_description='git apply symlinks and partial files
8 '
10 . ./test-lib.sh
12 if ! test_have_prereq SYMLINKS
13 then
14         say 'Symbolic links not supported, skipping tests.'
15         test_done
16         exit
17 fi
19 test_expect_success setup '
21         ln -s path1/path2/path3/path4/path5 link1 &&
22         git add link? &&
23         git commit -m initial &&
25         git branch side &&
27         rm -f link? &&
29         ln -s htap6 link1 &&
30         git update-index link? &&
31         git commit -m second &&
33         git diff-tree -p HEAD^ HEAD >patch  &&
34         git apply --stat --summary patch
36 '
38 test_expect_success 'apply symlink patch' '
40         git checkout side &&
41         git apply patch &&
42         git diff-files -p >patched &&
43         test_cmp patch patched
45 '
47 test_expect_success 'apply --index symlink patch' '
49         git checkout -f side &&
50         git apply --index patch &&
51         git diff-index --cached -p HEAD >patched &&
52         test_cmp patch patched
54 '
56 test_done