Subject: Re: [Outreachy PATCH v3 3/3] environment: move "branch.autoSetupMerge" into `struct repo_config_values`

From: Phillip Wood <[email-masked]>
Date: Thu, 22 Jan 2026 14:41:22 +0000

Hi Olamide

On 17/01/2026 20:59, Olamide Caleb Bello wrote:
> The config value `brach.autoSetupMerge` is parsed in
> `git_default_branch_config()` and stored in the global variable
> `git_branch_track`. This global variable can cause unexpected behaviours
> when multiple Git repos run in the the same process.
> 
> Move this value into `struct repo_config_values` to retain current
> behaviours while achieving repository scoped access.

Same comment as the previous patch about repository scoped access.

> diff --git a/environment.h b/environment.h
> index 3b5ff7094a..bfcdffe836 100644
> --- a/environment.h
> +++ b/environment.h
> @@ -2,6 +2,7 @@
>   #define ENVIRONMENT_H
>   
>   #include "repo-settings.h"
> +#include "branch.h"
>   
>   /* Double-check local_repo_env below if you add to this list. */
>   #define GIT_DIR_ENVIRONMENT "GIT_DIR"
> @@ -89,6 +90,9 @@ struct repo_config_values {
>   	/* core config values */
>   	char *attributes_file_path;
>   	int sparse_checkout;
> +
> +	/* branch config values */
> +	enum branch_track git_branch_track;

We could probably drop the "git_" prefix now that it is not a global 
variable.

Thanks

Phillip