]> git.99rst.org Git - git.git/commit
repository: introduce repo_config_values_clear()
authorTian Yuchen <redacted>
Tue, 14 Jul 2026 03:25:16 +0000 (11:25 +0800)
committerJunio C Hamano <redacted>
Tue, 14 Jul 2026 14:30:23 +0000 (07:30 -0700)
commit0201d2783e6317c7b76e9c511cbfcfa73fdc17b1
treefceece5a2087d624f0c4cd9c3ee87a1ca53f6d01
parentab776a62a78576513ee121424adb19597fbb7613
repository: introduce repo_config_values_clear()

As part of the ongoing libification effort, dynamically allocated
global configuration variables are being moved into
'struct repo_config_values'. To prevent memory leaks, we need a
destructor to free these heap-allocated variables when a repository
instance is torn down.

Introduce 'repo_config_values_clear()' in environment.c and invoke it
from 'repo_clear()' in repository.c. As a starting point, update this
new function to handle the cleanup of 'attributes_file'.

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>
environment.c
environment.h
repository.c
git clone https://git.99rst.org/PROJECT