From 07b29bfd8d3de9a16c1c93e285b6980ca6b77b45 Mon Sep 17 00:00:00 2001 From: Christian Couder Date: Sun, 24 Jan 2016 16:28:20 +0100 Subject: 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 Signed-off-by: Junio C Hamano --- builtin/update-index.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'builtin/update-index.c') diff --git a/builtin/update-index.c b/builtin/update-index.c index 5f8630c61b..d90154c59a 100644 --- a/builtin/update-index.c +++ b/builtin/update-index.c @@ -1126,11 +1126,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix) add_untracked_cache(&the_index); report(_("Untracked cache enabled for '%s'"), get_git_work_tree()); } else if (untracked_cache == UC_DISABLE) { - if (the_index.untracked) { - free_untracked_cache(the_index.untracked); - the_index.untracked = NULL; - the_index.cache_changed |= UNTRACKED_CHANGED; - } + remove_untracked_cache(&the_index); report(_("Untracked cache disabled")); } -- cgit v1.2.1