| 172 | } |
| 173 | |
| 174 | static 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 | |
| 194 | static struct submodule *cache_lookup_name(struct submodule_cache *cache, |
| 195 | const struct object_id *gitmodules_oid, const char *name) |
no test coverage detected