diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-03-07 01:59:51 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-03-07 01:59:51 +0100 |
commit | 7d0c1f4556ad89b2f7eae97d31ea85c3bfdf7c87 (patch) | |
tree | cce91296a436de34b3f81fe0ea4b433110ec69b5 /unpack-trees.c | |
parent | Merge tag 'l10n-2.21.0-rnd2.1' of git://github.com/git-l10n/git-po (diff) | |
parent | revert "checkout: introduce checkout.overlayMode config" (diff) | |
download | git-7d0c1f4556ad89b2f7eae97d31ea85c3bfdf7c87.tar.xz git-7d0c1f4556ad89b2f7eae97d31ea85c3bfdf7c87.zip |
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.c | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/unpack-trees.c b/unpack-trees.c index 3563daae1a..22c41a3ba8 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) |