Re: [Outreachy PATCH v2] environment: move "core.attributesFile" into repo-setting
From: Phillip Wood <hidden>
Date: 2026-01-07 14:19:07
On 07/01/2026 10:26, Phillip Wood wrote:
On 06/01/2026 13:44, Bello Olamide wrote:quoted
But won't this be a temporary solution since the goal is to prevent the use of `the_repository`?Yes but it would be a good start as passing a repository down to git_default_config() will be quite invasive.
To expand on this the first steps could be
(i) create a new struct to hold the config settings from
git_default_config()
(ii) add that struct as a member of `struct repository`
(iii) one-by-one, for each setting parsed by git_default_config() add a
new member to the config struct, store the parsed value in
`the_repository` and adjust any code that uses the variable.
Then later we can tackle the intrusive change to pass a `struct
repository` down to git_default_config() and store the settings in that
rather than `the_repository`. If we add a local variable to
git_default_config() in step (iii) above then getting it to use the
repository passed down the call chain will simply be a matter of doing
something like
- struct repository *r = the_repository;
+ struct repository *r = cb ? cb : the_repository;
Thanks
Phillip