hook.c: add a hook_exists() wrapper and use it in bugreport.c

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>
This commit is contained in:
Emily Shaffer
2021-09-26 21:03:27 +02:00
committed by Junio C Hamano
parent 5e3aba33da
commit 330155ed8a
3 changed files with 11 additions and 1 deletions

5
hook.c
View File

@ -35,3 +35,8 @@ const char *find_hook(const char *name)
}
return path.buf;
}
int hook_exists(const char *name)
{
return !!find_hook(name);
}