]> git.99rst.org Git - git.git/commit
environment: move excludes_file into repo_config_values
authorTian Yuchen <redacted>
Tue, 14 Jul 2026 03:25:17 +0000 (11:25 +0800)
committerJunio C Hamano <redacted>
Tue, 14 Jul 2026 14:30:23 +0000 (07:30 -0700)
commit7488b9d1fd505ce1194b98893508fa5b194cf0cd
treec98bcf0550c26788dd87dae922733e64fcbea8d1
parent0201d2783e6317c7b76e9c511cbfcfa73fdc17b1
environment: move excludes_file into repo_config_values

The global variable 'excludes_file' is used to track the path to the
global ignore file. If this variable is NULL,
'setup_standard_excludes()' in 'dir.c' forcefully evaluates and assigns
the XDG default path to it.

Continue the libification effort by encapsulating this lazy-loading
fallback logic into a proper getter and moving the variable into
'struct repo_config_values'.

Since 'excludes_file' is a dynamically allocated string, it requires
proper heap memory management. It is safely freed using the newly
introduced 'repo_config_values_clear()' function when the repository
is torn down.

Mentored-by: Christian Couder <redacted>
Mentored-by: Ayush Chandekar <redacted>
Mentored-by: Olamide Caleb Bello <redacted>
Signed-off-by: Tian Yuchen <redacted>
Signed-off-by: Junio C Hamano <redacted>
dir.c
environment.c
environment.h
git clone https://git.99rst.org/PROJECT