summaryrefslogtreecommitdiff
path: root/diff-lib.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-05-23 08:40:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-05-23 08:40:33 (GMT)
commit3ed24211d48d9a297b3784347acbf7e0265a58f3 (patch)
tree9f17d3a6437704ae543655d8a84d2ec064f02a1a /diff-lib.c
parent5781e80ffd4cd0c52cdfbf85cac3bb299544a2fc (diff)
parent53996fe5397ff37c5934bb5e9b23ef5985b3d152 (diff)
downloadgit-3ed24211d48d9a297b3784347acbf7e0265a58f3.zip
git-3ed24211d48d9a297b3784347acbf7e0265a58f3.tar.gz
git-3ed24211d48d9a297b3784347acbf7e0265a58f3.tar.bz2
Merge branch 'lt/maint-diff-reduce-lstat'
* lt/maint-diff-reduce-lstat: Teach 'git checkout' to preload the index contents Avoid unnecessary 'lstat()' calls in 'get_stat_data()'
Diffstat (limited to 'diff-lib.c')
-rw-r--r--diff-lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/diff-lib.c b/diff-lib.c
index a310fb2..0aba6cd 100644
--- a/diff-lib.c
+++ b/diff-lib.c
@@ -214,7 +214,7 @@ static int get_stat_data(struct cache_entry *ce,
const unsigned char *sha1 = ce->sha1;
unsigned int mode = ce->ce_mode;
- if (!cached) {
+ if (!cached && !ce_uptodate(ce)) {
int changed;
struct stat st;
changed = check_removed(ce, &st);