summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--builtin/update-index.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin/update-index.c b/builtin/update-index.c
index 7431938fa6..a6fff87c1d 100644
--- a/builtin/update-index.c
+++ b/builtin/update-index.c
@@ -1123,6 +1123,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
add_untracked_ident(the_index.untracked);
the_index.cache_changed |= UNTRACKED_CHANGED;
} else if (!untracked_cache && the_index.untracked) {
+ free_untracked_cache(the_index.untracked);
the_index.untracked = NULL;
the_index.cache_changed |= UNTRACKED_CHANGED;
}