From 5e3aba33da26803e48b0099c9dabfd327f7f8b8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sun, 26 Sep 2021 21:03:26 +0200 Subject: hook.[ch]: move find_hook() from run-command.c to hook.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move the find_hook() function from run-command.c to a new hook.c library. This change establishes a stub library that's pretty pointless right now, but will see much wider use with Emily Shaffer's upcoming "configuration-based hooks" series. Eventually all the hook related code will live in hook.[ch]. Let's start that process by moving the simple find_hook() function over as-is. Signed-off-by: Emily Shaffer Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- hook.h | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 hook.h (limited to 'hook.h') diff --git a/hook.h b/hook.h new file mode 100644 index 0000000000..68624f1605 --- /dev/null +++ b/hook.h @@ -0,0 +1,11 @@ +#ifndef HOOK_H +#define HOOK_H + +/* + * Returns the path to the hook file, or NULL if the hook is missing + * or disabled. Note that this points to static storage that will be + * overwritten by further calls to find_hook and run_hook_*. + */ +const char *find_hook(const char *name); + +#endif -- cgit v1.2.3