]> git.ipfire.org Git - thirdparty/git.git/commitdiff
gc: use hook library for pre-auto-gc hook
authorEmily Shaffer <emilyshaffer@google.com>
Wed, 22 Dec 2021 03:59:29 +0000 (04:59 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 7 Jan 2022 23:19:34 +0000 (15:19 -0800)
Move the pre-auto-gc hook away from run-command.h to and over to the
new hook.h library. This uses the new run_hooks() wrapper.

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/gc.c

index bcef6a4c8da71f54d923bbccc7a152a068e3b8c4..4bbc58aae5bb6126d2a17efb969eb0daba109ac6 100644 (file)
@@ -32,6 +32,7 @@
 #include "remote.h"
 #include "object-store.h"
 #include "exec-cmd.h"
+#include "hook.h"
 
 #define FAILED_RUN "failed to run %s"
 
@@ -394,7 +395,7 @@ static int need_to_gc(void)
        else
                return 0;
 
-       if (run_hook_le(NULL, "pre-auto-gc", NULL))
+       if (run_hooks("pre-auto-gc"))
                return 0;
        return 1;
 }