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 <emilyshaffer@google.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
}
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]);
}
}
return path.buf;
}
+
+int hook_exists(const char *name)
+{
+ return !!find_hook(name);
+}
*/
const char *find_hook(const char *name);
+/**
+ * A boolean version of find_hook()
+ */
+int hook_exists(const char *hookname);
+
#endif