Expand description
Hook execution utilities.
Provides a reusable function for running Git hooks from .git/hooks/
or from the directory configured via core.hooksPath.
Enums§
- Hook
Result - Result of running a hook.
Functions§
- resolve_
hooks_ dir - Resolve the hooks directory from config or fall back to
$GIT_DIR/hooks. - run_
hook - Run a hook by name with the given arguments.
- run_
hook_ capture - run_
hook_ in_ git_ dir - Like
run_hookbut captures stdout and returns it alongside the result. Run a hook with extra env vars, setting cwd to GIT_DIR (for receive-side hooks). - run_
hook_ with_ env - Like
run_hookbut with extra environment variables and captures output.