]> git.99rst.org Git - git.git/commit
builtin/init: simplify logic to configure worktree
authorPatrick Steinhardt <redacted>
Thu, 11 Jun 2026 06:44:40 +0000 (08:44 +0200)
committerJunio C Hamano <redacted>
Thu, 11 Jun 2026 12:05:54 +0000 (05:05 -0700)
commit65eb5b989aa6d7f764d097c6759f6b6189eb0d27
treeeca67a5d8fb4e583ba2ad98055ff21a2906a275e
parent9bef2cf33111dc844e46a8a19c266320774f4bd6
builtin/init: simplify logic to configure worktree

In the preceding commit we have stopped modifying the global
`git_work_tree_cfg` variable. With this change there's now some code
paths where we end up setting the local `git_work_tree_cfg` variable,
but without actually using the value for anything.

Refactor the code a bit so that we only set the worktree configuration
in case it's actually needed. Furthermore, reflow it a bit to make the
code easier to follow.

Signed-off-by: Patrick Steinhardt <redacted>
Signed-off-by: Junio C Hamano <redacted>
builtin/init-db.c
git clone https://git.99rst.org/PROJECT