@@ -82,7 +82,7 @@ static void get_populated_hooks(struct strbuf *hook_info, int nongit)
}
for (i = 0; i < ARRAY_SIZE(hook); i++)
- if (find_hook(hook[i]))
+ if (hook_exists(hook[i]))
strbuf_addf(hook_info, "%s\n", hook[i]);
}
@@ -36,7 +36,10 @@ const char *find_hook(const char *name)
return path.buf;
}
-
+int hook_exists(const char *name)
+{
+ return !!find_hook(name);
+}
void run_hooks_opt_clear(struct run_hooks_opt *o)
{
@@ -44,6 +44,11 @@ struct hook_cb_data {
*/
const char *find_hook(const char *name);
+/*
+ * A boolean version of find_hook()
+ */
+int hook_exists(const char *hookname);
+
void run_hooks_opt_clear(struct run_hooks_opt *o);
/*