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 <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
330155ed8a
commit
07a348e746
@ -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
|
||||
|
||||
Reference in New Issue
Block a user