Code

Merge branch 'jc/maint-read-tree-multi'
[git.git] / entry.c
diff --git a/entry.c b/entry.c
index 5daacc2fe51eada819bedea05f958fbf87f5b889..915514aa5c43d3fd39f077a79f63ac27b841d255 100644 (file)
--- a/entry.c
+++ b/entry.c
@@ -147,7 +147,8 @@ static int write_entry(struct cache_entry *ce, char *path, const struct checkout
 
                wrote = write_in_full(fd, new, size);
                /* use fstat() only when path == ce->name */
-               if (state->refresh_cache && !to_tempfile && !state->base_dir_len) {
+               if (fstat_is_reliable() &&
+                   state->refresh_cache && !to_tempfile && !state->base_dir_len) {
                        fstat(fd, &st);
                        fstat_done = 1;
                }