]> git.ipfire.org Git - thirdparty/git.git/commit
setup: stop using `the_repository` in `set_git_work_tree()`
authorPatrick Steinhardt <ps@pks.im>
Tue, 19 May 2026 09:52:14 +0000 (11:52 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 19 May 2026 10:36:24 +0000 (19:36 +0900)
commit7a6a82fba02fb6644647e5beddb54d978918cec0
treecd02319b5d5c85280887d52444bc72af09d77a1e
parentbd2851d84ffe438cf4621da48abbff1877935d9a
setup: stop using `the_repository` in `set_git_work_tree()`

Stop using `the_repository` in `set_git_work_tree()` and instead accept
the repository as a parameter. The injection of `the_repository` is thus
bumped one level higher, where callers now pass it in explicitly.

Similar as with the preceding commit, we track whether the worktree has
been initialized already via a global variable so that we can die in
case the repository is re-initialized with a different worktree path.
Store this info in the `struct repository` instead so that we correctly
handle this per repository.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/clone.c
builtin/init-db.c
repository.h
setup.c
setup.h