summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorThomas Gummerer <t.gummerer@gmail.com>2018-12-20 13:48:14 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-01-02 23:28:05 (GMT)
commitb702dd12d52816e192578c6206db5e6c332ba49b (patch)
tree75999dad3b2d37c79cca7a1a4e1360544b08b119 /cache.h
parenta0cc58450a8ac81ba405f1e161599263d1678686 (diff)
downloadgit-b702dd12d52816e192578c6206db5e6c332ba49b.zip
git-b702dd12d52816e192578c6206db5e6c332ba49b.tar.gz
git-b702dd12d52816e192578c6206db5e6c332ba49b.tar.bz2
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 'cache.h')
-rw-r--r--cache.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index ca36b44..c1c953e 100644
--- a/cache.h
+++ b/cache.h
@@ -1542,6 +1542,11 @@ struct checkout {
extern int checkout_entry(struct cache_entry *ce, const struct checkout *state, char *topath);
extern void enable_delayed_checkout(struct checkout *state);
extern int finish_delayed_checkout(struct checkout *state);
+/*
+ * Unlink the last component and schedule the leading directories for
+ * removal, such that empty directories get removed.
+ */
+extern void unlink_entry(const struct cache_entry *ce);
struct cache_def {
struct strbuf path;