diff options
author | Thomas Gummerer <t.gummerer@gmail.com> | 2018-12-20 14:48:14 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-01-03 00:28:05 +0100 |
commit | b702dd12d52816e192578c6206db5e6c332ba49b (patch) | |
tree | 75999dad3b2d37c79cca7a1a4e1360544b08b119 /unpack-trees.c | |
parent | move worktree tests to t24* (diff) | |
download | git-b702dd12d52816e192578c6206db5e6c332ba49b.tar.xz git-b702dd12d52816e192578c6206db5e6c332ba49b.zip |
entry: factor out unlink_entry function
Factor out the 'unlink_entry()' function from unpack-trees.c to
entry.c. It will be used in other places as well in subsequent
steps.
As it's no longer a static function, also move the documentation to
the header file to make it more discoverable.
Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'unpack-trees.c')
-rw-r--r-- | unpack-trees.c | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/unpack-trees.c b/unpack-trees.c index 7570df481b..e8d1a6ac50 100644 --- a/unpack-trees.c +++ b/unpack-trees.c @@ -300,25 +300,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; |