Re: [PATCH 10/18] setup: stop using `the_repository` in `set_git_work_tree()`
On Fri, Apr 17, 2026 at 06:16:30PM -0700, Elijah Newren wrote:
Show 23 quoted lines
> On Mon, Mar 30, 2026 at 6:19 AM Patrick Steinhardt <ps@pks.im> wrote:
> > diff --git a/repository.h b/repository.h
> > index abeef3129e..7ae3d34484 100644
> > --- a/repository.h
> > +++ b/repository.h
> [...]
> > + bool worktree_initialized;
> > diff --git a/setup.c b/setup.c
> [...]
> >
> > -static int git_work_tree_initialized;
>
> Okay, so we replaced the global git_work_tree_intialized with a
> repository field named worktree_initialized, _and_ changed its type
> from int to bool...
>
> > - git_work_tree_initialized = 1;
> > - repo_set_worktree(the_repository, new_work_tree);
> > + repo->worktree_initialized = 1;
> > + repo_set_worktree(repo, new_work_tree);
>
> ...yet we still set it to "1". Shouldn't we initialize it to "true"
> given the typechange?
Good point, will fix.
Patrick