| 533 | } |
| 534 | |
| 535 | struct string_list *list_hooks(struct repository *r, const char *hookname, |
| 536 | struct run_hooks_opt *options) |
| 537 | { |
| 538 | struct string_list *hook_head; |
| 539 | |
| 540 | if (!hookname) |
| 541 | BUG("null hookname was provided to hook_list()!"); |
| 542 | |
| 543 | CALLOC_ARRAY(hook_head, 1); |
| 544 | string_list_init_dup(hook_head); |
| 545 | |
| 546 | /* Add hooks from the config, e.g. hook.myhook.event = pre-commit */ |
| 547 | list_hooks_add_configured(r, hookname, hook_head, options); |
| 548 | |
| 549 | /* Add the default "traditional" hooks from hookdir. */ |
| 550 | list_hooks_add_default(r, hookname, hook_head, options); |
| 551 | |
| 552 | return hook_head; |
| 553 | } |
| 554 | |
| 555 | int hook_exists(struct repository *r, const char *name) |
| 556 | { |
no test coverage detected