@@ -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)
@@ -489,7 +490,9 @@ 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("post-merge", &opt);
+ run_hooks_opt_clear(&opt);
apply_autostash(git_path_merge_autostash(the_repository));
strbuf_release(&reflog_message);
@@ -849,7 +852,7 @@ static void prepare_to_commit(struct commit_list *remoteheads)
* and write it out as a tree. We must do this before we invoke
* the editor and after we invoke run_status above.
*/
- if (find_hook("pre-merge-commit"))
+ if (hook_exists("pre-merge-commit"))
discard_cache();
read_cache_from(index_file);
strbuf_addbuf(&msg, &merge_msg);