summaryrefslogtreecommitdiffstats
path: root/reset.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 /reset.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 'reset.c')
-rw-r--r--reset.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/reset.c b/reset.c
index 9550dea03d..b22b1be792 100644
--- a/reset.c
+++ b/reset.c
@@ -79,7 +79,7 @@ static int update_refs(const struct reset_head_opts *opts,
reflog_head);
}
if (!ret && run_hook)
- run_hooks_l("post-checkout",
+ run_hooks_l(the_repository, "post-checkout",
oid_to_hex(head ? head : null_oid()),
oid_to_hex(oid), "1", NULL);
strbuf_release(&msg);