summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rerere.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/rerere.c b/rerere.c
index e1d527c250..d665debf0f 100644
--- a/rerere.c
+++ b/rerere.c
@@ -337,8 +337,10 @@ static int handle_cache(const char *path, unsigned char *sha1, const char *outpu
if (ce_namelen(ce) != len || memcmp(ce->name, path, len))
break;
i = ce_stage(ce) - 1;
- mmfile[i].ptr = read_sha1_file(ce->sha1, &type, &size);
- mmfile[i].size = size;
+ if (!mmfile[i].ptr) {
+ mmfile[i].ptr = read_sha1_file(ce->sha1, &type, &size);
+ mmfile[i].size = size;
+ }
}
for (i = 0; i < 3; i++)
if (!mmfile[i].ptr && !mmfile[i].size)