compat/poll: sleep 1 millisecond to avoid busy wait
[gitweb.git] / diff.c
diff --git a/diff.c b/diff.c
index e8006666d8a528689157aed0e84d23a5477111be..635dee244d767bffc689550fd3e32d0ac1a37fea 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)
@@ -3941,7 +3942,7 @@ static int diff_scoreopt_parse(const char *opt)
                }
        }
        if (cmd != 'M' && cmd != 'C' && cmd != 'B')
-               return -1; /* that is not a -M, -C nor -B option */
+               return -1; /* that is not a -M, -Cor -B option */
 
        opt1 = parse_rename_score(&opt);
        if (cmd != 'B')