Merge tag 'v2.8.6' into maint-2.9
[gitweb.git] / diff.c
diff --git a/diff.c b/diff.c
index fa78fc189cd7225767817a2d24ef6c3b19bef9d8..abff2eec2b0604786b09ff0ac7fae24e1df6677f 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -2682,6 +2682,13 @@ static int reuse_worktree_file(const char *name, const unsigned char *sha1, int
        if (!FAST_WORKING_DIRECTORY && !want_file && has_sha1_pack(sha1))
                return 0;
 
+       /*
+        * Similarly, if we'd have to convert the file contents anyway, that
+        * makes the optimization not worthwhile.
+        */
+       if (!want_file && would_convert_to_git(name))
+               return 0;
+
        len = strlen(name);
        pos = cache_name_pos(name, len);
        if (pos < 0)