Subject: Re: [PATCH 2/5] refs: make get_files_ref_lock_timeout_ms() repostory aware

From: Burak Kaan Karaçay <[email-masked]>
Date: Fri, 27 Mar 2026 12:23:59 +0300

On Wed Mar 25, 2026 at 7:44 PM +03, Shreyansh Paliwal wrote:
> -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