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