summaryrefslogtreecommitdiff
path: root/unpack-trees.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-03-07 00:59:51 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-03-07 00:59:51 (GMT)
commit7d0c1f4556ad89b2f7eae97d31ea85c3bfdf7c87 (patch)
treecce91296a436de34b3f81fe0ea4b433110ec69b5 /unpack-trees.c
parent36eb1cb9cfe327583128a4b0abdf9516c2ca815b (diff)
parente92aa0e4ef5a91781530449f9466a45c16c91f7f (diff)
downloadgit-7d0c1f4556ad89b2f7eae97d31ea85c3bfdf7c87.zip
git-7d0c1f4556ad89b2f7eae97d31ea85c3bfdf7c87.tar.gz
git-7d0c1f4556ad89b2f7eae97d31ea85c3bfdf7c87.tar.bz2
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 'unpack-trees.c')
-rw-r--r--unpack-trees.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/unpack-trees.c b/unpack-trees.c
index 3563daa..22c41a3 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -299,25 +299,6 @@ static void load_gitmodules_file(struct index_state *index,
}
}
-/*
- * Unlink the last component and schedule the leading directories for
- * removal, such that empty directories get removed.
- */
-static void unlink_entry(const struct cache_entry *ce)
-{
- const struct submodule *sub = submodule_from_ce(ce);
- if (sub) {
- /* state.force is set at the caller. */
- submodule_move_head(ce->name, "HEAD", NULL,
- SUBMODULE_MOVE_HEAD_FORCE);
- }
- if (!check_leading_path(ce->name, ce_namelen(ce)))
- return;
- if (remove_or_warn(ce->ce_mode, ce->name))
- return;
- schedule_dir_for_removal(ce->name, ce_namelen(ce));
-}
-
static struct progress *get_progress(struct unpack_trees_options *o)
{
unsigned cnt = 0, total = 0;
@@ -410,7 +391,7 @@ static int check_updates(struct unpack_trees_options *o)
unlink_entry(ce);
}
}
- remove_marked_cache_entries(index);
+ remove_marked_cache_entries(index, 0);
remove_scheduled_dirs();
if (should_update_submodules() && o->update && !o->dry_run)