3 # Copyright (c) 2005 Johannes Schindelin
6 test_description='Test diff of symlinks.
10 . "$TEST_DIRECTORY"/diff-lib.sh
12 if ! test_have_prereq SYMLINKS
14 say 'Symbolic links not supported, skipping tests.'
19 diff --git a/frotz b/frotz
21 index 0000000..7c465af
26 \ No newline at end of file
33 tree=$(git write-tree) &&
34 git update-index --add frotz &&
35 GIT_DIFF_OPTS=--unified=0 git diff-index -M -p $tree > current &&
36 compare_diff_patch current expected'
39 'diff unchanged symlink' \
40 'tree=$(git write-tree) &&
41 git update-index frotz &&
42 test -z "$(git diff-index --name-only $tree)"'
45 diff --git a/frotz b/frotz
46 deleted file mode 120000
47 index 7c465af..0000000
52 \ No newline at end of file
56 'diff removed symlink' \
58 git diff-index -M -p $tree > current &&
59 compare_diff_patch current expected'
62 diff --git a/frotz b/frotz
66 'diff identical, but newly created symlink' \
68 git diff-index -M -p $tree > current &&
69 compare_diff_patch current expected'
72 diff --git a/frotz b/frotz
73 index 7c465af..df1db54 120000
78 \ No newline at end of file
80 \ No newline at end of file
84 'diff different symlink' \
87 git diff-index -M -p $tree > current &&
88 compare_diff_patch current expected'
91 'diff symlinks with non-existing targets' \
93 ln -s take\ over brain &&
94 test_must_fail git diff --no-index pinky brain > output 2> output.err &&
96 ! grep error output.err'