aboutsummaryrefslogtreecommitdiff
path: root/diff-files.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-05-12 16:51:08 -0700
committerPetr Baudis <xpasky@machine.sinus.cz>2005-05-14 00:27:49 +0200
commit95649d6cf9ec68f05d1dc57ec1b989b8d263a7ae (patch)
tree71452301db9f0e49c458332bdeb72bbc6d2639ea /diff-files.c
parentf77b100ada80e9d149bf763ae64d563352ebb577 (diff)
downloadgit-95649d6cf9ec68f05d1dc57ec1b989b8d263a7ae.tar.gz
git-95649d6cf9ec68f05d1dc57ec1b989b8d263a7ae.tar.xz
[PATCH] Fix git-diff-files for symlinks.
Again I am not sure why this was missed during the last round, but git-diff-files mishandles symlinks on the filesystem. This patch fixes it. Signed-off-by: Junio C Hamano <junkio@cox.net> And I'm not sure why did I miss this patch before. Sorry. Signed-off-by: Petr Baudis <pasky@ucw.cz>
Diffstat (limited to 'diff-files.c')
-rw-r--r--diff-files.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/diff-files.c b/diff-files.c
index c51edc331..28f1b13b3 100644
--- a/diff-files.c
+++ b/diff-files.c
@@ -126,7 +126,8 @@ int main(int argc, char **argv)
continue;
oldmode = ntohl(ce->ce_mode);
- mode = S_IFREG | ce_permissions(st.st_mode);
+ mode = (S_ISLNK(st.st_mode) ? S_IFLNK :
+ S_IFREG | ce_permissions(st.st_mode));
show_modified(oldmode, mode, ce->sha1, null_sha1,
ce->name);