]> git.99rst.org Git - git.git/commit
setup: pass worktree to `init_db()`
authorPatrick Steinhardt <redacted>
Tue, 7 Jul 2026 07:21:31 +0000 (09:21 +0200)
committerJunio C Hamano <redacted>
Tue, 7 Jul 2026 17:49:41 +0000 (10:49 -0700)
commit293b7850a72a93af83bcfd6b0280ba26292b3690
tree62c635382065fb5860c096346797606761809f0a
parenteba53f5f5f392d3729f57144e707574bda5d37be
setup: pass worktree to `init_db()`

In the preceding commits we have refactored how we discover and set up
repositories so that we cannot end up with partially-configured repos.
Instead, we apply the gitdir, worktree and repository format in a single
location, only.

Initializing a new repository has the same antipattern though: while
most of the information for the new repository is passed via parameters,
the work tree is instead propagated by configuring the repository's work
tree.

Refactor the code so that we also pass the work tree as an explicit
parameter. Like this, configuration fo the repository happens in a
single spot, too, just as with repository discovery.

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