Message ID | patch-v2-06.13-327f916f8c3-20211015T093918Z-avarab@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | hook.[ch]: new library to run hooks + simple hook conversion | expand |
On Tue, Oct 12, 2021 at 03:30:31PM +0200, Ævar Arnfjörð Bjarmason wrote: > > > Teach post-merge to use the hook.h library instead of the > run-command.h library to run hooks. > > Signed-off-by: Emily Shaffer <emilyshaffer@google.com> > Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Reviewed-by: Emily Shaffer <emilyshaffer@google.com>
diff --git a/builtin/merge.c b/builtin/merge.c index cc4a910c69b..c48b875b82b 100644 --- a/builtin/merge.c +++ b/builtin/merge.c @@ -448,6 +448,7 @@ static void finish(struct commit *head_commit, const struct object_id *new_head, const char *msg) { struct strbuf reflog_message = STRBUF_INIT; + struct run_hooks_opt opt = RUN_HOOKS_OPT_INIT; const struct object_id *head = &head_commit->object.oid; if (!msg) @@ -488,7 +489,8 @@ static void finish(struct commit *head_commit, } /* Run a post-merge hook */ - run_hook_le(NULL, "post-merge", squash ? "1" : "0", NULL); + strvec_push(&opt.args, squash ? "1" : "0"); + run_hooks_oneshot("post-merge", &opt); apply_autostash(git_path_merge_autostash(the_repository)); strbuf_release(&reflog_message);