From 330155ed8af3b2e050ac74554993ba68d303e8c3 Mon Sep 17 00:00:00 2001 From: Emily Shaffer Date: Sun, 26 Sep 2021 21:03:27 +0200 Subject: hook.c: add a hook_exists() wrapper and use it in bugreport.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a boolean version of the find_hook() function for those callers who are only interested in checking whether the hook exists, not what the path to it is. Signed-off-by: Emily Shaffer Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- hook.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'hook.c') diff --git a/hook.c b/hook.c index ba70b31471..55e1145a4b 100644 --- a/hook.c +++ b/hook.c @@ -35,3 +35,8 @@ const char *find_hook(const char *name) } return path.buf; } + +int hook_exists(const char *name) +{ + return !!find_hook(name); +} -- cgit v1.2.3