dir: free untracked cache when removing it

Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Christian Couder committed Dec 29, 2015 at 08:09 UTC 9624a22ac603d3d59622b1f45a62d02f5fe55a25
1 file changed +1
builtin/update-index.c
+1
@@ -1123,6 +1123,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
1123 add_untracked_ident(the_index.untracked);
1124 the_index.cache_changed |= UNTRACKED_CHANGED;
1125 } else if (!untracked_cache && the_index.untracked) {
1126 + free_untracked_cache(the_index.untracked);
1127 the_index.untracked = NULL;
1128 the_index.cache_changed |= UNTRACKED_CHANGED;
1129 }