summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShreyansh Paliwal <shreyanshpaliwalcmsmn@gmail.com>2026-04-04 19:28:40 +0530
committerJunio C Hamano <gitster@pobox.com>2026-04-08 09:58:10 -0700
commit57c590feb96b2298e0966bea3ce88c72fca37bbd (patch)
tree80a320dbb3c5a9be2caead931997199eb21f11e1
parent9a03f165a41d708c672e18e69d43f69689981e7d (diff)
downloadgit-57c590feb96b2298e0966bea3ce88c72fca37bbd.tar.gz
git-57c590feb96b2298e0966bea3ce88c72fca37bbd.zip
refs/reftable-backend: drop uses of the_repository
reftable_be_init() and reftable_be_create_on_disk() use the_repository even though a repository instance is already available, either directly or via struct ref_store. Replace these uses with the appropriate local repository instance (repo or ref_store->repo) to avoid relying on global state. Note that USE_THE_REPOSITORY_VARIABLE cannot be removed yet, as is_bare_repository() is still there in the file. Signed-off-by: Shreyansh Paliwal <shreyanshpaliwalcmsmn@gmail.com> Acked-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--refs/reftable-backend.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/refs/reftable-backend.c b/refs/reftable-backend.c
index b124404663..7c8a992fcb 100644
--- a/refs/reftable-backend.c
+++ b/refs/reftable-backend.c
@@ -404,13 +404,13 @@ static struct ref_store *reftable_be_init(struct repository *repo,
default:
BUG("unknown hash algorithm %d", repo->hash_algo->format_id);
}
- refs->write_options.default_permissions = calc_shared_perm(the_repository, 0666 & ~mask);
+ refs->write_options.default_permissions = calc_shared_perm(repo, 0666 & ~mask);
refs->write_options.disable_auto_compact =
!git_env_bool("GIT_TEST_REFTABLE_AUTOCOMPACTION", 1);
refs->write_options.lock_timeout_ms = 100;
refs->write_options.fsync = reftable_be_fsync;
- repo_config(the_repository, reftable_be_config, &refs->write_options);
+ repo_config(repo, reftable_be_config, &refs->write_options);
/*
* It is somewhat unfortunate that we have to mirror the default block
@@ -492,7 +492,7 @@ static int reftable_be_create_on_disk(struct ref_store *ref_store,
struct strbuf sb = STRBUF_INIT;
strbuf_addf(&sb, "%s/reftable", refs->base.gitdir);
- safe_create_dir(the_repository, sb.buf, 1);
+ safe_create_dir(ref_store->repo, sb.buf, 1);
strbuf_reset(&sb);
strbuf_release(&sb);