summaryrefslogtreecommitdiff
path: root/diff-lib.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2009-05-23 01:40:33 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2009-05-23 01:40:33 -0700
commit3ed24211d48d9a297b3784347acbf7e0265a58f3 (patch)
tree9f17d3a6437704ae543655d8a84d2ec064f02a1a /diff-lib.c
parentMerge branch 'jm/format-patch-no-auto-n-when-k-is-given' (diff)
parentTeach 'git checkout' to preload the index contents (diff)
downloadtgif-3ed24211d48d9a297b3784347acbf7e0265a58f3.tar.xz
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 a310fb2ad0..0aba6cda3c 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);