5 #include "run-command.h"
8 /* The path to the hook */
14 /* Environment vars to be set for each hook */
17 /* Args to be passed to each hook */
20 /* Number of threads to parallelize across */
23 /* Resolve and run the "absolute_path(hook)" instead of
24 * "hook". Used for "git worktree" hooks
28 /* Path to initial working directory for subprocess */
33 #define RUN_HOOKS_OPT_INIT { \
36 .args = STRVEC_INIT, \
40 * Callback provided to feed_pipe_fn and consume_sideband_fn.
44 const char *hook_name;
46 struct run_hooks_opt *options;
50 * Returns the path to the hook file, or NULL if the hook is missing
51 * or disabled. Note that this points to static storage that will be
52 * overwritten by further calls to find_hook and run_hook_*.
54 const char *find_hook(const char *name);
57 * A boolean version of find_hook()
59 int hook_exists(const char *hookname);
61 void run_hooks_opt_clear(struct run_hooks_opt *o);
64 * Calls find_hook(hookname) and runs the hooks (if any) with
67 int run_hooks(const char *hook_name, struct run_hooks_opt *options);
70 * Takes an already resolved hook and runs it. Internally the simpler
71 * run_hooks() will call this.
73 int run_found_hooks(const char *hookname, const char *hook_path,
74 struct run_hooks_opt *options);