rebase: convert pre-rebase to use hook.h
Move the pre-rebase hook away from run-command.h to and over to the new hook.h library. Since this hook needs arguments introduce a run_hooksl() wrapper, like run_hooks(), but it takes varargs. 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
25d4e02cfc249601081c560590ce2a74aca6de3d
1 file changed
+2
-1
builtin/rebase.c
+2
-1
@@ -28,6 +28,7 @@
28
#include "sequencer.h"
29
#include "rebase-interactive.h"
30
#include "reset.h"
31
+#include "hook.h"
32
33
#define DEFAULT_REFLOG_ACTION "rebase"
34
@@ -1712,7 +1713,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
1713
1714
/* If a hook exists, give it a chance to interrupt*/
1715
if (!ok_to_skip_pre_rebase &&
1715
- run_hook_le(NULL, "pre-rebase", options.upstream_arg,
1716
+ run_hooks_l("pre-rebase", options.upstream_arg,
1717
argc ? argv[0] : NULL, NULL))
1718
die(_("The pre-rebase hook refused to rebase."));
1719