From: Junio C Hamano Date: Thu, 12 May 2005 23:51:08 +0000 (-0700) Subject: [PATCH] Fix git-diff-files for symlinks. X-Git-Tag: v0.99~584 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=95649d6cf9ec68f05d1dc57ec1b989b8d263a7ae;p=git.git [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 And I'm not sure why did I miss this patch before. Sorry. Signed-off-by: Petr Baudis --- diff --git a/diff-files.c b/diff-files.c index c51edc33..28f1b13b 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);