diff --git a/diff-lib.c b/diff-lib.c
index 349f612b615fc152e9d272900b1ac5177f4a025c..1c7e652a8048524e73f2f34833647d7ec1610bc9 100644 (file)
--- a/diff-lib.c
+++ b/diff-lib.c
continue;
}
- if (ce_uptodate(ce))
+ if (ce_uptodate(ce) || ce_skip_worktree(ce))
continue;
/* If CE_VALID is set, don't look at workdir for file removal */
int match_missing, cached;
/* if the entry is not checked out, don't examine work tree */
- cached = o->index_only || (idx && (idx->ce_flags & CE_VALID));
+ cached = o->index_only ||
+ (idx && ((idx->ce_flags & CE_VALID) || ce_skip_worktree(idx)));
/*
* Backward compatibility wart - "diff-index -m" does
* not mean "do not ignore merges", but "match_missing".