Skip to content

hooks: add custom post-command hook config #736

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 7, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions git.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ static int run_post_command_hook(struct repository *r)

run_post_hook = 0;
strvec_clear(&sargv);
strvec_clear(&opt.args);
setenv("COMMAND_HOOK_LOCK", "false", 1);
return ret;
}
Expand Down
5 changes: 4 additions & 1 deletion hook.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,12 +320,15 @@ int run_hooks_l(struct repository *r, const char *hook_name, ...)
{
struct run_hooks_opt opt = RUN_HOOKS_OPT_INIT;
va_list ap;
int result;
const char *arg;

va_start(ap, hook_name);
while ((arg = va_arg(ap, const char *)))
strvec_push(&opt.args, arg);
va_end(ap);

return run_hooks_opt(r, hook_name, &opt);
result = run_hooks_opt(r, hook_name, &opt);
strvec_clear(&opt.args);
return result;
}
Loading