summaryrefslogtreecommitdiffstats
path: root/sequencer.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-08-13 11:13:28 +0200
committerJunio C Hamano <gitster@pobox.com>2024-08-13 19:01:01 +0200
commit169c979771158ddc3310f7a1e0e141fd7d0ed088 (patch)
treee01728374589fb980fef51ede875399b275a9647 /sequencer.c
parenteditor: do not rely on `the_repository` for interactive edits (diff)
downloadgit-169c979771158ddc3310f7a1e0e141fd7d0ed088.tar.xz
git-169c979771158ddc3310f7a1e0e141fd7d0ed088.zip
hooks: remove implicit dependency on `the_repository`
We implicitly depend on `the_repository` in our hook subsystem because we use `strbuf_git_path()` to compute hook paths. Remove this dependency by accepting a `struct repository` as parameter instead. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sequencer.c b/sequencer.c
index 0291920f0b..edeeec6f15 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -1316,7 +1316,7 @@ static int run_rewrite_hook(const struct object_id *oldoid,
struct child_process proc = CHILD_PROCESS_INIT;
int code;
struct strbuf sb = STRBUF_INIT;
- const char *hook_path = find_hook("post-rewrite");
+ const char *hook_path = find_hook(the_repository, "post-rewrite");
if (!hook_path)
return 0;
@@ -1614,7 +1614,7 @@ static int try_to_commit(struct repository *r,
}
}
- if (hook_exists("prepare-commit-msg")) {
+ if (hook_exists(r, "prepare-commit-msg")) {
res = run_prepare_commit_msg_hook(r, msg, hook_commit);
if (res)
goto out;
@@ -5149,7 +5149,7 @@ cleanup_head_ref:
hook_opt.path_to_stdin = rebase_path_rewritten_list();
strvec_push(&hook_opt.args, "rebase");
- run_hooks_opt("post-rewrite", &hook_opt);
+ run_hooks_opt(r, "post-rewrite", &hook_opt);
}
apply_autostash(rebase_path_autostash());