path: root/builtin/commit.c
diff options
authorÆvar Arnfjörð Bjarmason <>2021-09-26 19:03:28 (GMT)
committerJunio C Hamano <>2021-09-27 16:44:54 (GMT)
commit07a348e7461afe9411004a0501034cb3ff1cdee8 (patch)
treea32c560bec3ad2619c621d52c79455d1dd66196a /builtin/commit.c
parent330155ed8af3b2e050ac74554993ba68d303e8c3 (diff)
hook.c users: use "hook_exists()" instead of "find_hook()"
Use the new hook_exists() function instead of find_hook() where the latter was called in boolean contexts. This make subsequent changes in a series where we further refactor the hook API clearer, as we won't conflate wanting to get the path of the hook with checking for its existence. Signed-off-by: Ævar Arnfjörð Bjarmason <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'builtin/commit.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index 5359d96..883c162 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -1052,7 +1052,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
return 0;
- if (!no_verify && find_hook("pre-commit")) {
+ if (!no_verify && hook_exists("pre-commit")) {
* Re-read the index as pre-commit hook could have updated it,
* and write it out as a tree. We must do this before we invoke