Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2009-01-29 19:30:51 +0300
committerJunio C Hamano <gitster@pobox.com>2009-01-31 08:11:24 +0300
commit418566b6fdcc0eb1b5549d0742366aa13a7ff277 (patch)
treea2d36ff84e44fef36ed1e9d556aea94c6d5a78a6 /t/t4011-diff-symlink.sh
parent41a4d16e200d24b2435148e974b665429931abc9 (diff)
Fix 'git diff --no-index' with a non-existing symlink target
When trying to find out mode changes, we should not access the symlink targets using stat(); instead we use lstat() so that the diff does not fail trying to find a non-existing symlink target. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4011-diff-symlink.sh')
-rwxr-xr-xt/t4011-diff-symlink.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/t/t4011-diff-symlink.sh b/t/t4011-diff-symlink.sh
index 02efecae3a..9055c8b318 100755
--- a/t/t4011-diff-symlink.sh
+++ b/t/t4011-diff-symlink.sh
@@ -82,4 +82,11 @@ test_expect_success \
git diff-index -M -p $tree > current &&
compare_diff_patch current expected'
+test_expect_success \
+ 'diff symlinks with non-existing targets' \
+ 'ln -s narf pinky &&
+ ln -s take\ over brain &&
+ test_must_fail git diff --no-index pinky brain > output 2> output.err &&
+ grep narf output &&
+ ! grep error output.err'
test_done