setup: stop using the_repository in enter_repo()

Stop using `the_repository` in `enter_repo()` and instead accept the
repository as a parameter. The injection of `the_repository` is thus
bumped one level higher, where callers now pass it in explicitly.

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-05-19 11:52:12 +02:00
committed by Junio C Hamano
parent 920dba4581
commit ea1d0f886d
7 changed files with 9 additions and 9 deletions

View File

@@ -1765,7 +1765,7 @@ enum discovery_result discover_git_directory_reason(struct strbuf *commondir,
return result;
}
const char *enter_repo(const char *path, unsigned flags)
const char *enter_repo(struct repository *repo, const char *path, unsigned flags)
{
static struct strbuf validated_path = STRBUF_INIT;
static struct strbuf used_path = STRBUF_INIT;
@@ -1838,7 +1838,7 @@ const char *enter_repo(const char *path, unsigned flags)
}
if (is_git_directory(".")) {
set_git_dir(the_repository, ".", 0);
set_git_dir(repo, ".", 0);
check_repository_format(NULL);
return path;
}