Skip to main content

Module hooks

Module hooks 

Source
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§

HookResult
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_hook but 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_hook but with extra environment variables and captures output.