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' \
69 git diff-index -M -p $tree > current &&
70 compare_diff_patch current expected'
73 diff --git a/frotz b/frotz
74 index 7c465af..df1db54 120000
79 \ No newline at end of file
81 \ No newline at end of file
85 'diff different symlink' \
88 git diff-index -M -p $tree > current &&
89 compare_diff_patch current expected'
92 'diff symlinks with non-existing targets' \
94 ln -s take\ over brain &&
95 test_must_fail git diff --no-index pinky brain > output 2> output.err &&
97 ! grep error output.err'