Re: [PATCH v2 5/5] refs/packed-backend: use ref_store->repo instead of the_repository
- From
Tian Yuchen <a3205153416@gmail.com>
- Date
- Mar 28, 2026, 17:08 UTC
- Message-ID
- <b2c143af-22c0-4266-b641-5ccdeb221251@gmail.com>
- In-Reply-To
- <20260328141146.1095115-6-shreyanshpaliwalcmsmn@gmail.com>
On 3/28/26 22:09, Shreyansh Paliwal wrote:
Show 24 quoted lines
> In refs/packed-backend.c, repo_config_get_int() is called using the global > the_repository, even though a repository instance is available via struct > ref_store. > > Replace the use of the_repository with ref_store->repo to make the code > explicitly repository-aware. With no remaining users of the_repository in > this file, drop the USE_THE_REPOSITORY_VARIABLE macro. > > Signed-off-by: Shreyansh Paliwal <shreyanshpaliwalcmsmn@gmail.com> > --- > refs/packed-backend.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/refs/packed-backend.c b/refs/packed-backend.c > index 23ed62984b..ebc10dab4d 100644 > --- a/refs/packed-backend.c > +++ b/refs/packed-backend.c > @@ -1,4 +1,3 @@ > -#define USE_THE_REPOSITORY_VARIABLE > #define DISABLE_SIGN_COMPARE_WARNINGS > > #include "../git-compat-util.h" > @@ -1223,7 +1222,7 @@ int packed_refs_lock(struct ref_store *ref_store, int flags, struct strbuf *err) > static int timeout_value = 1000;
Burak already pointed out the issue with the static keyword in patch 3 of v1. Notice that it's here as well.
Show 7 quoted lines
>
> if (!timeout_configured) {
> - repo_config_get_int(the_repository, "core.packedrefstimeout", &timeout_value);
> + repo_config_get_int(ref_store->repo, "core.packedrefstimeout", &timeout_value);
> timeout_configured = 1;
> }
> Regards, Yuchen