path: root/read-cache.c
diff options
authorJunio C Hamano <>2019-03-07 00:59:51 (GMT)
committerJunio C Hamano <>2019-03-07 00:59:51 (GMT)
commit7d0c1f4556ad89b2f7eae97d31ea85c3bfdf7c87 (patch)
treecce91296a436de34b3f81fe0ea4b433110ec69b5 /read-cache.c
parent36eb1cb9cfe327583128a4b0abdf9516c2ca815b (diff)
parente92aa0e4ef5a91781530449f9466a45c16c91f7f (diff)
Merge branch 'tg/checkout-no-overlay'
"git checkout --no-overlay" can be used to trigger a new mode of checking out paths out of the tree-ish, that allows paths that match the pathspec that are in the current index and working tree and are not in the tree-ish. * tg/checkout-no-overlay: revert "checkout: introduce checkout.overlayMode config" checkout: introduce checkout.overlayMode config checkout: introduce --{,no-}overlay option checkout: factor out mark_cache_entry_for_checkout function checkout: clarify comment read-cache: add invalidate parameter to remove_marked_cache_entries entry: support CE_WT_REMOVE flag in checkout_entry entry: factor out unlink_entry function move worktree tests to t24*
Diffstat (limited to 'read-cache.c')
1 files changed, 7 insertions, 1 deletions
diff --git a/read-cache.c b/read-cache.c
index 0e0c93e..75ff234 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -588,13 +588,19 @@ int remove_index_entry_at(struct index_state *istate, int pos)
* CE_REMOVE is set in ce_flags. This is much more effective than
* calling remove_index_entry_at() for each entry to be removed.
-void remove_marked_cache_entries(struct index_state *istate)
+void remove_marked_cache_entries(struct index_state *istate, int invalidate)
struct cache_entry **ce_array = istate->cache;
unsigned int i, j;
for (i = j = 0; i < istate->cache_nr; i++) {
if (ce_array[i]->ce_flags & CE_REMOVE) {
+ if (invalidate) {
+ cache_tree_invalidate_path(istate,
+ ce_array[i]->name);
+ untracked_cache_remove_from_index(istate,
+ ce_array[i]->name);
+ }
remove_name_hash(istate, ce_array[i]);
save_or_free_index_entry(istate, ce_array[i]);