mirror of
https://github.com/git-for-windows/git.git
synced 2026-04-29 22:49:20 -05:00
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>
This commit is contained in:
committed by
Junio C Hamano
parent
e282d01b4a
commit
4f924d92cd
2
git.c
2
git.c
@@ -497,7 +497,7 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv, struct
|
||||
commit_pager_choice();
|
||||
|
||||
if (!help && p->option & NEED_WORK_TREE)
|
||||
setup_work_tree();
|
||||
setup_work_tree(the_repository);
|
||||
|
||||
trace_argv_printf(argv, "trace: built-in: git");
|
||||
trace2_cmd_name(p->cmd);
|
||||
|
||||
Reference in New Issue
Block a user