summaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2014-06-13 19:19:42 +0700
committerJunio C Hamano <gitster@pobox.com>2014-06-13 11:49:41 -0700
commitce7c614bceedf0c0169dd5b02cae3e33ee45acdd (patch)
treef4299db57da7bafc4d38a6b3d0bea85cb214b4c7 /read-cache.c
parent76b07b37a3fff15ce4852bd070a610b651c42e77 (diff)
downloadgit-ce7c614bceedf0c0169dd5b02cae3e33ee45acdd.tar.gz
split-index: do not invalidate cache-tree at read time
We are sure that after merge_base_index() is done. cache-tree can still be used with the final index. So don't destroy cache tree. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/read-cache.c b/read-cache.c
index 1a7ef7f783..d5f70a08b9 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -950,7 +950,8 @@ static int add_index_entry_with_check(struct index_state *istate, struct cache_e
int skip_df_check = option & ADD_CACHE_SKIP_DFCHECK;
int new_only = option & ADD_CACHE_NEW_ONLY;
- cache_tree_invalidate_path(istate, ce->name);
+ if (!(option & ADD_CACHE_KEEP_CACHE_TREE))
+ cache_tree_invalidate_path(istate, ce->name);
pos = index_name_stage_pos(istate, ce->name, ce_namelen(ce), ce_stage(ce));
/* existing match? Just replace it. */