summaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorChristian Couder <christian.couder@gmail.com>2017-03-06 10:42:01 +0100
committerJunio C Hamano <gitster@pobox.com>2017-03-06 12:09:28 -0800
commitc3a008250272295271584c6303463ffb9b055cbc (patch)
tree400ad7fcb74a7cac0d411ffff745fbe3bf7d38cd /read-cache.c
parentde6ae5f9e3e0960e2adcba4688ed4293edc8424a (diff)
downloadgit-c3a008250272295271584c6303463ffb9b055cbc.tar.gz
read-cache: use freshen_shared_index() in read_index_from()
This way a share index file will not be garbage collected if we still read from an index it is based from. As we need to read the current index before creating a new one, the tests have to be adjusted, so that we don't expect an old shared index file to be deleted right away when we create a new one. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/read-cache.c b/read-cache.c
index ace3fc515b..8cf0673adc 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -1727,6 +1727,7 @@ int read_index_from(struct index_state *istate, const char *path)
base_sha1_hex, base_path,
sha1_to_hex(split_index->base->sha1));
+ freshen_shared_index(base_sha1_hex, 0);
merge_base_index(istate);
post_read_index_from(istate);
return ret;