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

Function cache_add

submodule-config.c:163–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161}
162
163static void cache_add(struct submodule_cache *cache,
164 struct submodule *submodule)
165{
166 unsigned int hash = hash_oid_string(&submodule->gitmodules_oid,
167 submodule->name);
168 struct submodule_entry *e = xmalloc(sizeof(*e));
169 hashmap_entry_init(&e->ent, hash);
170 e->config = submodule;
171 hashmap_add(&cache->for_name, &e->ent);
172}
173
174static const struct submodule *cache_lookup_path(struct submodule_cache *cache,
175 const struct object_id *gitmodules_oid, const char *path)

Callers 1

lookup_or_create_by_nameFunction · 0.85

Calls 4

hash_oid_stringFunction · 0.85
hashmap_entry_initFunction · 0.85
hashmap_addFunction · 0.85
xmallocFunction · 0.70

Tested by

no test coverage detected