]> Kevux Git Server - rit/commit
hook: move is_known_hook() to hook.c for wider use
authorAdrian Ratiu <adrian.ratiu@collabora.com>
Fri, 10 Apr 2026 09:06:05 +0000 (12:06 +0300)
committerJunio C Hamano <gitster@pobox.com>
Fri, 10 Apr 2026 14:58:54 +0000 (07:58 -0700)
commit2eb541e8f2a9b0dd923279421c741d0a0c00420d
treed547830c2821f52273e050c1a08349823762cefd
parent5e57b209ff21bf1087dd8539c458737c89b03150
hook: move is_known_hook() to hook.c for wider use

Move is_known_hook() from builtin/hook.c (static) into hook.c and
export it via hook.h so it can be reused.

Make it return bool and the iterator `h` for clarity (iterate hooks).

Both meson.build and the Makefile are updated to reflect that the
header is now used by libgit, not the builtin sources.

The next commit will use this to reject hook friendly-names that
collide with known event names.

Co-authored-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile
builtin/hook.c
hook.c
hook.h
meson.build