aboutsummaryrefslogtreecommitdiff
path: root/worktree.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-06-20 15:53:13 -0700
committerJunio C Hamano <gitster@pobox.com>2023-06-20 15:53:13 -0700
commit7cb4274d2606775b0d5b373756f76f386a31bb64 (patch)
tree4b3ddb8b70ec60ca3ff8402c9924ef547f717a65 /worktree.c
parent9cd234e6465ab2bea5c402f0d9ee1495501250ef (diff)
parent3867f6d650c89230ae7393e2d57160ccc14758c7 (diff)
downloadgit-7cb4274d2606775b0d5b373756f76f386a31bb64.tar.xz
Merge branch 'vd/worktree-config-is-per-repository'
The value of config.worktree is per-repository, but has been kept in a singleton global variable per process. This has been OK as most Git operations interacted with a single repository at a time, but not right for operations like recursive "grep" that want to access multiple repositories from a single process without forking. The global variable has been eliminated and made into a member in the per-repository data structure. * vd/worktree-config-is-per-repository: repository: move 'repository_format_worktree_config' to repo scope config: pass 'repo' directly to 'config_with_options()' config: use gitdir to get worktree config
Diffstat (limited to 'worktree.c')
-rw-r--r--worktree.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/worktree.c b/worktree.c
index b5ee71c5eb..c448fecd4b 100644
--- a/worktree.c
+++ b/worktree.c
@@ -806,7 +806,7 @@ int init_worktree_config(struct repository *r)
* If the extension is already enabled, then we can skip the
* upgrade process.
*/
- if (repository_format_worktree_config)
+ if (r->repository_format_worktree_config)
return 0;
if ((res = git_config_set_gently("extensions.worktreeConfig", "true")))
return error(_("failed to set extensions.worktreeConfig setting"));
@@ -846,7 +846,7 @@ int init_worktree_config(struct repository *r)
* Ensure that we use worktree config for the remaining lifetime
* of the current process.
*/
- repository_format_worktree_config = 1;
+ r->repository_format_worktree_config = 1;
cleanup:
git_configset_clear(&cs);