Re: [PATCH v2 1/7] builtin/init: stop modifying global `git_work_tree_cfg` variable
From: Patrick Steinhardt <hidden>
Date: 2026-06-12 09:27:57
On Fri, Jun 12, 2026 at 10:04:35AM +0200, Toon Claes wrote:
Patrick Steinhardt [off-list ref] writes:quoted
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:quoted
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