| 161 | } |
| 162 | |
| 163 | static 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 | |
| 174 | static const struct submodule *cache_lookup_path(struct submodule_cache *cache, |
| 175 | const struct object_id *gitmodules_oid, const char *path) |
no test coverage detected