Thread (1 message) 1 message, 1 author, 2016-06-15
DORMANTno replies

[PATCH] Fix git-diff-files for symlinks.

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:41:57

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 <redacted>
---

*** Petr, this one falls into "emergency obvious fix" category.
*** I found it during adding more "basic" test to the test suite,
*** which turns out to be quite useful.

diff-files.c |    3 ++-
1 files changed, 2 insertions(+), 1 deletion(-)
--- a/diff-files.c
+++ b/diff-files.c
@@ -126,7 +126,8 @@
 			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);
------------------------------------------------
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help