Re: [PATCH v2 1/7] builtin/init: stop modifying global `git_work_tree_cfg` variable
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Jun 12, 2026, 09:27 UTC
- Message-ID
- <aivRFY4T9ACtuoFP@pks.im>
- In-Reply-To
- <87pl1wyyjw.fsf@emacs.iotcl.com>
On Fri, Jun 12, 2026 at 10:04:35AM +0200, Toon Claes wrote:
Show 16 quoted lines
> Patrick Steinhardt <ps@pks.im> writes: > > > When executing git-init(1) we need to figure out the final location of > > the worktree. This location can be configured in a couple of ways: via > > an environment variable, via the preexisting "core.worktree" config in > > case we're reinitializing, or implicitly when reinitializing a non-bare > > repository. > > Do you mean: > > > case we're reinitializing, or implicitly when initializing a non-bare > > repository. > > So the second 'init' without the 're'? > > Obviously not worth a reroll on it's own.
It can actually happen in both cases. I've queued the following change locally. Thanks!
Patrick
1: 0808dbb336 ! 1: cc6999257c builtin/init: stop modifying global `git_work_tree_cfg` variable
@@ Commit message
When executing git-init(1) we need to figure out the final location of
the worktree. This location can be configured in a couple of ways: via
an environment variable, via the preexisting "core.worktree" config in
- case we're reinitializing, or implicitly when reinitializing a non-bare
- repository.
+ case we're reinitializing, or implicitly when (re)initializing a
+ non-bare repository. When checking for the worktree location in "builtin/init-db.c" we
populate any potentially-discovered value both by setting the global