From 3867f6d650c89230ae7393e2d57160ccc14758c7 Mon Sep 17 00:00:00 2001 From: Victoria Dye Date: Fri, 26 May 2023 01:33:00 +0000 Subject: repository: move 'repository_format_worktree_config' to repo scope Move 'repository_format_worktree_config' out of the global scope and into the 'repository' struct. This change is similar to how 'repository_format_partial_clone' was moved in ebaf3bcf1ae (repository: move global r_f_p_c to repo struct, 2021-06-17), adding it to the 'repository' struct and updating 'setup.c' & 'repository.c' functions to assign the value appropriately. The primary goal of this change is to be able to load the worktree config of a submodule depending on whether that submodule - not its superproject - has 'extensions.worktreeConfig' enabled. To ensure 'do_git_config_sequence()' has access to the newly repo-scoped configuration, add a 'struct repository' argument to 'do_git_config_sequence()' and pass it the 'repo' value from 'config_with_options()'. Finally, add/update tests in 't3007-ls-files-recurse-submodules.sh' to verify 'extensions.worktreeConfig' is read an used independently by superprojects and submodules. Signed-off-by: Victoria Dye Signed-off-by: Junio C Hamano --- repository.h | 1 + 1 file changed, 1 insertion(+) (limited to 'repository.h') diff --git a/repository.h b/repository.h index 1a13ff2867..74ae26635a 100644 --- a/repository.h +++ b/repository.h @@ -163,6 +163,7 @@ struct repository { struct promisor_remote_config *promisor_remote_config; /* Configurations */ + int repository_format_worktree_config; /* Indicate if a repository has a different 'commondir' from 'gitdir' */ unsigned different_commondir:1; -- cgit v1.2.3