Merge branch 'sh/write-pack-file-warning-message-fix'
[gitweb.git] / diff.c
diff --git a/diff.c b/diff.c
index 7c59bfe2d08edd8fe0f13b5487c1af34043d7ef1..e9a8874d069469f4893add139c4b5d999fc36630 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)