gc: use hook library for pre-auto-gc hook

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>

Emily Shaffer committed Dec 22, 2021 at 04:59 UTC bad62a8cd5f2394d5c76104f324b0aa8b8c38867
1 file changed +2 -1
builtin/gc.c
+2 -1
@@ -32,6 +32,7 @@
32 #include "remote.h"
33 #include "object-store.h"
34 #include "exec-cmd.h"
35 +#include "hook.h"
36
37 #define FAILED_RUN "failed to run %s"
38
@@ -394,7 +395,7 @@ static int need_to_gc(void)
395 else
396 return 0;
397
397 - if (run_hook_le(NULL, "pre-auto-gc", NULL))
398 + if (run_hooks("pre-auto-gc"))
399 return 0;
400 return 1;
401 }