summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authorChristian Couder <christian.couder@gmail.com>2016-01-24 16:28:20 +0100
committerJunio C Hamano <gitster@pobox.com>2016-01-25 12:40:11 -0800
commit07b29bfd8d3de9a16c1c93e285b6980ca6b77b45 (patch)
treee63f874f30994dc539b63f0e680cc4c03080b963 /dir.c
parent4a4ca4796df6b81d5995f31e87e9e6a64c2b889d (diff)
downloadgit-07b29bfd8d3de9a16c1c93e285b6980ca6b77b45.tar.gz
dir: add remove_untracked_cache()
Factor out code into remove_untracked_cache(), which will be used in a later commit. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/dir.c b/dir.c
index 31eae37f5b..0d069c9054 100644
--- a/dir.c
+++ b/dir.c
@@ -1956,6 +1956,15 @@ void add_untracked_cache(struct index_state *istate)
istate->cache_changed |= UNTRACKED_CHANGED;
}
+void remove_untracked_cache(struct index_state *istate)
+{
+ if (istate->untracked) {
+ free_untracked_cache(istate->untracked);
+ istate->untracked = NULL;
+ istate->cache_changed |= UNTRACKED_CHANGED;
+ }
+}
+
static struct untracked_cache_dir *validate_untracked_cache(struct dir_struct *dir,
int base_len,
const struct pathspec *pathspec)