read-cache.c: clear and free "sparse_checkout_patterns"
The "sparse_checkout_patterns" member was added to the "struct
index_state" in 836e25c51b
(sparse-checkout: hold pattern list in
index, 2021-03-30), but wasn't added to discard_index(). Let's do
that.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
This commit is contained in:

committed by
Junio C Hamano

parent
03267e8656
commit
b5fcb1c006
@ -2558,6 +2558,11 @@ int discard_index(struct index_state *istate)
|
||||
free_untracked_cache(istate->untracked);
|
||||
istate->untracked = NULL;
|
||||
|
||||
if (istate->sparse_checkout_patterns) {
|
||||
clear_pattern_list(istate->sparse_checkout_patterns);
|
||||
FREE_AND_NULL(istate->sparse_checkout_patterns);
|
||||
}
|
||||
|
||||
if (istate->ce_mem_pool) {
|
||||
mem_pool_discard(istate->ce_mem_pool, should_validate_cache_entries());
|
||||
FREE_AND_NULL(istate->ce_mem_pool);
|
||||
|
Reference in New Issue
Block a user