diff --git a/read-cache.c b/read-cache.c index 705469eb7a90f3168acec47740d6b8b6b2661864..34d2e5ea428895253180c26c6eb3db6c6e032ed3 100644 --- a/read-cache.c +++ b/read-cache.c @@ -997,7 +997,8 @@ static int add_index_entry_with_check(struct index_state *istate, struct cache_e } pos = -pos-1; - untracked_cache_add_to_index(istate, ce->name); + if (!(option & ADD_CACHE_KEEP_CACHE_TREE)) + untracked_cache_add_to_index(istate, ce->name); /* * Inserting a merged entry ("stage 0") into the index