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

Function submodule_cache_clear

submodule-config.c:104–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104static void submodule_cache_clear(struct submodule_cache *cache)
105{
106 struct hashmap_iter iter;
107 struct submodule_entry *entry;
108
109 if (!cache->initialized)
110 return;
111
112 /*
113 * We iterate over the name hash here to be symmetric with the
114 * allocation of struct submodule entries. Each is allocated by
115 * their .gitmodules blob sha1 and submodule name.
116 */
117 hashmap_for_each_entry(&cache->for_name, &iter, entry,
118 ent /* member name */)
119 free_one_config(entry);
120
121 hashmap_clear_and_free(&cache->for_path, struct submodule_entry, ent);
122 hashmap_clear_and_free(&cache->for_name, struct submodule_entry, ent);
123 cache->initialized = 0;
124 cache->gitmodules_read = 0;
125}
126
127void submodule_cache_free(struct submodule_cache *cache)
128{

Callers 2

submodule_cache_freeFunction · 0.85
submodule_freeFunction · 0.85

Calls 1

free_one_configFunction · 0.85

Tested by

no test coverage detected