Merge branch 'bp/commit-p-editor' into maint
[gitweb.git] / diff.c
diff --git a/diff.c b/diff.c
index e8006666d8a528689157aed0e84d23a5477111be..1cd4672d0328525a30969b40bda4b5cc4d95d374 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -2845,8 +2845,9 @@ static struct diff_tempfile *prepare_temp_file(const char *name,
                remove_tempfile_installed = 1;
        }
 
-       if (!one->sha1_valid ||
-           reuse_worktree_file(name, one->sha1, 1)) {
+       if (!S_ISGITLINK(one->mode) &&
+           (!one->sha1_valid ||
+            reuse_worktree_file(name, one->sha1, 1))) {
                struct stat st;
                if (lstat(name, &st) < 0) {
                        if (errno == ENOENT)