]> git.ipfire.org Git - thirdparty/git.git/commitdiff
am: convert {pre,post}-applypatch to use hook.h
authorEmily Shaffer <emilyshaffer@google.com>
Wed, 22 Dec 2021 03:59:30 +0000 (04:59 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 7 Jan 2022 23:19:34 +0000 (15:19 -0800)
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>
builtin/am.c

index 8677ea2348ab5b8017fc82cd1f8b79e4a7d20122..4b334cb7b123ff5a8963166d76f879ab530391cf 100644 (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);
 }