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

Function cache_lookup_path

submodule-config.c:174–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172}
173
174static const struct submodule *cache_lookup_path(struct submodule_cache *cache,
175 const struct object_id *gitmodules_oid, const char *path)
176{
177 struct submodule_entry *entry;
178 unsigned int hash = hash_oid_string(gitmodules_oid, path);
179 struct submodule_entry key;
180 struct submodule key_config;
181
182 oidcpy(&key_config.gitmodules_oid, gitmodules_oid);
183 key_config.path = path;
184
185 hashmap_entry_init(&key.ent, hash);
186 key.config = &key_config;
187
188 entry = hashmap_get_entry(&cache->for_path, &key, ent, NULL);
189 if (entry)
190 return entry->config;
191 return NULL;
192}
193
194static struct submodule *cache_lookup_name(struct submodule_cache *cache,
195 const struct object_id *gitmodules_oid, const char *name)

Callers 1

config_fromFunction · 0.85

Calls 3

hash_oid_stringFunction · 0.85
oidcpyFunction · 0.85
hashmap_entry_initFunction · 0.85

Tested by

no test coverage detected