Files
git/builtin/diff-index.c
Patrick Steinhardt 4f924d92cd setup: stop using the_repository in setup_work_tree()
Stop using `the_repository` in `setup_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.

Note that the function tracks bogus worktree configuration via a global
variable. If we have bogus configuration, and if later on some caller
tries to setup a worktree, then we'll die instead.

Of course, tracking this as a global variable doesn't make sense anymore
now that we can set up worktrees for arbitrary repositories. Move the
variable into `struct repository` instead.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-30 13:14:19 -07:00

2.2 KiB