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>
This commit is contained in:
Patrick Steinhardt
2024-08-13 11:13:28 +02:00
committed by Junio C Hamano
parent 419dbb29d8
commit 169c979771
18 changed files with 47 additions and 42 deletions

View File

@@ -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);