* The hook config cache maps each hook event name to a string_list where * every item's string is the hook's friendly-name and its util pointer is * the corresponding command string. Both strings are owned by the map. * * Disabled hooks are kept in the cache with entry->disabled set, so that * "git hook list" can display them. A non-disabled hook missing a command * is fatal; a disabled hook
| 296 | * in the cache with entry->command = NULL. |
| 297 | */ |
| 298 | void hook_cache_clear(struct strmap *cache) |
| 299 | { |
| 300 | struct hashmap_iter iter; |
| 301 | struct strmap_entry *e; |
| 302 | |
| 303 | strmap_for_each_entry(cache, &iter, e) { |
| 304 | struct string_list *hooks = e->value; |
| 305 | for (size_t i = 0; i < hooks->nr; i++) { |
| 306 | struct hook_config_cache_entry *entry = hooks->items[i].util; |
| 307 | free(entry->command); |
| 308 | free(entry); |
| 309 | } |
| 310 | string_list_clear(hooks, 0); |
| 311 | free(hooks); |
| 312 | } |
| 313 | strmap_clear(cache, 0); |
| 314 | } |
| 315 | |
| 316 | /* |
| 317 | * Return true if `name` is a hook friendly-name, i.e. it has at least one of |
no test coverage detected