MCPcopy Create free account
hub / github.com/git/git / release_index

Function release_index

read-cache.c:2426–2454  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2424}
2425
2426void release_index(struct index_state *istate)
2427{
2428 /*
2429 * Cache entries in istate->cache[] should have been allocated
2430 * from the memory pool associated with this index, or from an
2431 * associated split_index. There is no need to free individual
2432 * cache entries. validate_cache_entries can detect when this
2433 * assertion does not hold.
2434 */
2435 validate_cache_entries(istate);
2436
2437 resolve_undo_clear_index(istate);
2438 free_name_hash(istate);
2439 cache_tree_free(&(istate->cache_tree));
2440 free(istate->fsmonitor_last_update);
2441 free(istate->cache);
2442 discard_split_index(istate);
2443 free_untracked_cache(istate->untracked);
2444
2445 if (istate->sparse_checkout_patterns) {
2446 clear_pattern_list(istate->sparse_checkout_patterns);
2447 FREE_AND_NULL(istate->sparse_checkout_patterns);
2448 }
2449
2450 if (istate->ce_mem_pool) {
2451 mem_pool_discard(istate->ce_mem_pool, should_validate_cache_entries());
2452 FREE_AND_NULL(istate->ce_mem_pool);
2453 }
2454}
2455
2456void discard_index(struct index_state *istate)
2457{

Callers 11

move_cache_to_base_indexFunction · 0.85
read_index_fromFunction · 0.85
discard_indexFunction · 0.85
create_index_from_treeFunction · 0.85
save_untracked_filesFunction · 0.85
stash_stagedFunction · 0.85
stash_patchFunction · 0.85
stash_working_treeFunction · 0.85
write_ondisk_indexFunction · 0.85
split_commitFunction · 0.85
run_dir_diffFunction · 0.85

Calls 9

validate_cache_entriesFunction · 0.85
resolve_undo_clear_indexFunction · 0.85
free_name_hashFunction · 0.85
cache_tree_freeFunction · 0.85
discard_split_indexFunction · 0.85
free_untracked_cacheFunction · 0.85
clear_pattern_listFunction · 0.85
mem_pool_discardFunction · 0.85

Tested by

no test coverage detected