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

Function is_friendly_name

hook.c:322–336  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

320 * deliberately excluded because it can appear under both namespaces.
321 */
322static 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. */
339static void warn_jobs_on_friendly_names(struct hook_all_config_cb *cb_data)

Callers 2

build_hook_config_mapFunction · 0.85

Calls 2

strmap_getFunction · 0.85

Tested by

no test coverage detected