Re: [PATCH 2/5] refs: make get_files_ref_lock_timeout_ms() repostory aware
- From
Burak Kaan Karaçay <bkkaracay@gmail.com>
- Date
- Mar 27, 2026, 09:23 UTC
- Message-ID
- <DHDGF1CL2QHP.101BB8D2101N8@gmail.com>
- In-Reply-To
- <20260325164833.1216577-3-shreyanshpaliwalcmsmn@gmail.com>
On Wed Mar 25, 2026 at 7:44 PM +03, Shreyansh Paliwal wrote:
Show 14 quoted lines
> -long get_files_ref_lock_timeout_ms(void)
> +long get_files_ref_lock_timeout_ms(struct repository *repo)
> {
> static int configured = 0;
>
> @@ -998,7 +998,7 @@ long get_files_ref_lock_timeout_ms(void)
> static int timeout_ms = 100;
>
> if (!configured) {
> - repo_config_get_int(the_repository, "core.filesreflocktimeout", &timeout_ms);
> + repo_config_get_int(repo, "core.filesreflocktimeout", &timeout_ms);
> configured = 1;
> }
> Looks like the existing code uses static local variables for performance. They can behave unexpectedly in multi-repo cases.
I think moving the config into 'repo-settings' should be considered. The config is already lazy-parsed, migrating it shouldn't be a problem.
Best, Burak Kaan Karaçay