summaryrefslogtreecommitdiff
path: root/diff-no-index.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2009-01-29 16:30:51 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-01-31 05:11:24 (GMT)
commit418566b6fdcc0eb1b5549d0742366aa13a7ff277 (patch)
treea2d36ff84e44fef36ed1e9d556aea94c6d5a78a6 /diff-no-index.c
parent41a4d16e200d24b2435148e974b665429931abc9 (diff)
downloadgit-418566b6fdcc0eb1b5549d0742366aa13a7ff277.zip
git-418566b6fdcc0eb1b5549d0742366aa13a7ff277.tar.gz
git-418566b6fdcc0eb1b5549d0742366aa13a7ff277.tar.bz2
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 'diff-no-index.c')
-rw-r--r--diff-no-index.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/diff-no-index.c b/diff-no-index.c
index 60ed174..0dbd9da 100644
--- a/diff-no-index.c
+++ b/diff-no-index.c
@@ -40,7 +40,7 @@ static int get_mode(const char *path, int *mode)
*mode = 0;
else if (!strcmp(path, "-"))
*mode = create_ce_mode(0666);
- else if (stat(path, &st))
+ else if (lstat(path, &st))
return error("Could not access '%s'", path);
else
*mode = st.st_mode;