summaryrefslogtreecommitdiff
path: root/diff-lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'diff-lib.c')
-rw-r--r--diff-lib.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/diff-lib.c b/diff-lib.c
index 5e6bca5906..6abb981534 100644
--- a/diff-lib.c
+++ b/diff-lib.c
@@ -424,6 +424,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 (!has_symlinks &&
+ S_ISREG(newmode) && S_ISLNK(oldmode))
+ newmode = oldmode;
diff_change(&revs->diffopt, oldmode, newmode,
ce->sha1, (changed ? null_sha1 : ce->sha1),
ce->name, NULL);