From f9b3c1f731dd12144cd6d1e27787e99beb3a631f Mon Sep 17 00:00:00 2001 From: Olamide Caleb Bello Date: Mon, 16 Feb 2026 17:38:25 +0100 Subject: environment: stop storing `core.attributesFile` globally The `core.attributeFile` config value is parsed in git_default_core_config(), loaded eagerly and stored in the global variable `git_attributes_file`. Storing this value in a global variable can lead to it being overwritten by another repository when more than one Git repository run in the same Git process. Create a new struct `repo_config_values` to hold this value and other repository dependent values parsed by `git_default_config()`. This will ensure the current behaviour remains the same while also enabling the libification of Git. An accessor function 'repo_config_values()' s created to ensure that we do not access an uninitialized repository, or an instance of a different repository than the current one. Suggested-by: Phillip Wood Mentored-by: Christian Couder Mentored-by: Usman Akinyemi Helped-by: Junio C Hamano Signed-off-by: Olamide Caleb Bello Signed-off-by: Junio C Hamano --- oss-fuzz/fuzz-commit-graph.c | 1 + 1 file changed, 1 insertion(+) (limited to 'oss-fuzz/fuzz-commit-graph.c') diff --git a/oss-fuzz/fuzz-commit-graph.c b/oss-fuzz/fuzz-commit-graph.c index fb8b8787a4..59bbb849d1 100644 --- a/oss-fuzz/fuzz-commit-graph.c +++ b/oss-fuzz/fuzz-commit-graph.c @@ -10,6 +10,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { struct commit_graph *g; + memset(the_repository, 0, sizeof(*the_repository)); initialize_repository(the_repository); /* -- cgit v1.3-5-g9baa