am: convert {pre,post}-applypatch to use hook.h

Teach pre-applypatch and post-applypatch to use the hook.h library
instead of the run-command.h library.

Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Acked-by: Emily Shaffer <emilyshaffer@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Emily Shaffer 2021-12-22 04:59:30 +01:00 committed by Junio C Hamano
parent bad62a8cd5
commit 593ffdd80b

View File

@ -1609,7 +1609,7 @@ static void do_commit(const struct am_state *state)
const char *reflog_msg, *author, *committer = NULL;
struct strbuf sb = STRBUF_INIT;
if (run_hook_le(NULL, "pre-applypatch", NULL))
if (run_hooks("pre-applypatch"))
exit(1);
if (write_cache_as_tree(&tree, 0, NULL))
@ -1661,7 +1661,7 @@ static void do_commit(const struct am_state *state)
fclose(fp);
}
run_hook_le(NULL, "post-applypatch", NULL);
run_hooks("post-applypatch");
strbuf_release(&sb);
}