Windows: avoid the "dup dance" when spawning a child process
[gitweb.git] / diff.c
diff --git a/diff.c b/diff.c
index aad4b3977a2960bac1391b4b3ec8afe814308902..04beb26a6a8aa46b5b0721b71236553cf549061b 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -1997,7 +1997,7 @@ static int reuse_worktree_file(const char *name, const unsigned char *sha1, int
         * If ce is marked as "assume unchanged", there is no
         * guarantee that work tree matches what we are looking for.
         */
-       if (ce->ce_flags & CE_VALID)
+       if ((ce->ce_flags & CE_VALID) || ce_skip_worktree(ce))
                return 0;
 
        /*