From: Tian Yuchen Date: Wed, 01 Jul 2026 18:08:11 GMT Subject: [PATCH v6 0/1] environment: move excludes_file into repo_config_values Message-ID: <20260701180813.776173-1-cat@malon.dev> In-Reply-To: <20260630164401.2906091-1-cat@malon.dev> This patch continues the libification effort by migrating the global string variable 'excludes_file' into 'struct repo_config_values'. Since this is a dynamically allocated variable, the migration requires proper heap memory management. This patch mainly does three things: - Abstract the XDG fallback lazy-loading logic out of dir.c into a proper getter. - Move the variables into the struct repo_config_values. - Introduce the memory destructor 'repo_config_values_clear()'. Changes since V5: Drop the defensive check in 'repo_excludes_file()'. All known test errors that occur *without* defensive checks are intercepted by the 'repo != the_repository' check when checks *are there*, rather than by the '!repo->initialized' check. In other words, the getter actually doesn't need any checks added, because all of its calls are safe. We just need to keep the check and the 'NEEDSWORK' comment *on the destructor* until 'repo_config_values()' eventually supports submodules, at which point we can remove them. THANKS! Mentored-by: Christian Couder Mentored-by: Ayush Chandekar Mentored-by: Olamide Caleb Bello Signed-off-by: Tian Yuchen Tian Yuchen (1): environment: move excludes_file into repo_config_values dir.c | 4 ++-- environment.c | 33 ++++++++++++++++++++++++++++++--- environment.h | 13 ++++++++++++- repository.c | 1 + 4 files changed, 45 insertions(+), 6 deletions(-) -- 2.43.0