[PATCH] diff-lib.c: Ignore type differences if the filesystem does not support symlinks.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If core.symlinks = false, the diff engine now compares the symlink in the
index or in the database with the file contents on disk (instead of insisting
in a symlink in the working copy).

As a side effect, git status now reports a change as "modified" instead of
"typechange".

Signed-off-by: Johannes Sixt <johannes.sixt@xxxxxxxxxx>
---
 diff-lib.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/diff-lib.c b/diff-lib.c
index 60c0fa6..3a12f65 100644
--- a/diff-lib.c
+++ b/diff-lib.c
@@ -134,6 +134,9 @@ int run_diff_files(struct rev_info *revs, int silent_on_removed)
 		    S_ISREG(newmode) && S_ISREG(oldmode) &&
 		    ((newmode ^ oldmode) == 0111))
 			newmode = oldmode;
+		else if (!trust_symlink_fmt &&
+		    S_ISREG(newmode) && S_ISLNK(oldmode))
+			newmode = oldmode;
 		diff_change(&revs->diffopt, oldmode, newmode,
 			    ce->sha1, (changed ? null_sha1 : ce->sha1),
 			    ce->name, NULL);
-- 
1.5.0.19.gddff

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]