Skip to content

Commit 9c88148

Browse files
shreyp135gitster
authored andcommitted
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> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent f45ae8d commit 9c88148

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

refs/reftable-backend.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,13 +404,13 @@ static struct ref_store *reftable_be_init(struct repository *repo,
404404
default:
405405
BUG("unknown hash algorithm %d", repo->hash_algo->format_id);
406406
}
407-
refs->write_options.default_permissions = calc_shared_perm(the_repository, 0666 & ~mask);
407+
refs->write_options.default_permissions = calc_shared_perm(repo, 0666 & ~mask);
408408
refs->write_options.disable_auto_compact =
409409
!git_env_bool("GIT_TEST_REFTABLE_AUTOCOMPACTION", 1);
410410
refs->write_options.lock_timeout_ms = 100;
411411
refs->write_options.fsync = reftable_be_fsync;
412412

413-
repo_config(the_repository, reftable_be_config, &refs->write_options);
413+
repo_config(repo, reftable_be_config, &refs->write_options);
414414

415415
/*
416416
* 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,
492492
struct strbuf sb = STRBUF_INIT;
493493

494494
strbuf_addf(&sb, "%s/reftable", refs->base.gitdir);
495-
safe_create_dir(the_repository, sb.buf, 1);
495+
safe_create_dir(ref_store->repo, sb.buf, 1);
496496
strbuf_reset(&sb);
497497

498498
strbuf_release(&sb);

0 commit comments

Comments
 (0)