worktree: pass repository to public functions

Refactor remaining public functions that still depend on
`the_repository` to instead receive a repository as parameter. This
allows us to get rid of `USE_THE_REPOSITORY_VARIABLE`.

Adapt callers accordingly.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt
2026-07-16 07:33:06 +02:00
committed by Junio C Hamano
parent 2cec1c92e6
commit e2533e0915
19 changed files with 120 additions and 97 deletions

View File

@@ -2494,7 +2494,7 @@ static void relocate_single_git_dir_into_superproject(const char *path,
if (validate_submodule_path(path) < 0)
exit(128);
if (submodule_uses_worktrees(path))
if (submodule_uses_worktrees(the_repository, path))
die(_("relocate_gitdir for submodule '%s' with "
"more than one worktree not supported"), path);