* Return true if `name` is a hook friendly-name, i.e. it has at least one of * .command, .event, or .parallel configured. These are the reliable clues * that distinguish a friendly-name from an event name. Note: .enabled is * deliberately excluded because it can appear under both namespaces. */
| 320 | * deliberately excluded because it can appear under both namespaces. |
| 321 | */ |
| 322 | static int is_friendly_name(struct hook_all_config_cb *cb, const char *name) |
| 323 | { |
| 324 | struct hashmap_iter iter; |
| 325 | struct strmap_entry *e; |
| 326 | |
| 327 | if (strmap_get(&cb->commands, name) || strmap_get(&cb->parallel_hooks, name)) |
| 328 | return 1; |
| 329 | |
| 330 | strmap_for_each_entry(&cb->event_hooks, &iter, e) { |
| 331 | if (unsorted_string_list_lookup(e->value, name)) |
| 332 | return 1; |
| 333 | } |
| 334 | |
| 335 | return 0; |
| 336 | } |
| 337 | |
| 338 | /* Warn if any name in event_jobs is also a hook friendly-name. */ |
| 339 | static void warn_jobs_on_friendly_names(struct hook_all_config_cb *cb_data) |
no test coverage detected