[PATCH] patman: fix use in worktree

Simon Glass sjg at chromium.org
Thu May 7 17:32:19 CEST 2026


Hi Ludwig,

On Wed, 6 May 2026 at 05:47, Ludwig Nussel <ludwig.nussel at siemens.com> wrote:
>
> On 5/5/26 16:01, Simon Glass wrote:
> > Hi Ludwig,
> >
> > On Tue, 5 May 2026 at 02:25, Ludwig Nussel <ludwig.nussel at siemens.com> wrote:
> >>
> >> On 5/4/26 14:31, Simon Glass wrote:
> >>> On 2026-04-29T12:18:51, Ludwig Nussel <ludwig.nussel at siemens.com> wrote:
> >>>> patman: fix use in worktree
> >>>>
> >>>> When using a worktree '.git' actually is a file and pygit2
> >>>> init_repository() does not like that. The intention is not to create
> >>>> a new git repo anyway so use normal constructor instead of
> >>>> init_repository().
> >>>>
> >>>> Signed-off-by: Ludwig Nussel <ludwig.nussel at siemens.com>
> >>>>
> >>>> tools/patman/cser_helper.py | 4 ++--
> >>>>    tools/patman/cseries.py     | 6 +++---
> >>>>    2 files changed, 5 insertions(+), 5 deletions(-)
> >>>
> >>>> diff --git a/tools/patman/cser_helper.py b/tools/patman/cser_helper.py
> >>>> @@ -309,7 +309,7 @@ class CseriesHelper:
> >>>>            self._copy_db_fields_to(series, ser)
> >>>>            msg = None
> >>>>            if end:
> >>>> -            repo = pygit2.init_repository(self.gitdir)
> >>>> +            repo = pygit2.Repository(self.gitdir)
> >>>
> >>> Thanks for tracking this down.
> >>>
> >>> There are more init_repository(self.gitdir) call sites have landed in
> >>> cser_helper.py and cseries.py - please can you convert those too,
> >>> otherwise the worktree case will still be broken on those paths.
> >>
> >> In which branch? In master I can only see init_repository() references
> >> in tests.
> >
> > This is in the master branch at http:...
> >
> > $ git grep init_repos
> > tools/patman/cser_helper.py:            repo =
> > pygit2.init_repository(self.gitdir)
> > tools/patman/cser_helper.py:        repo = pygit2.init_repository(self.gitdir)
> > tools/patman/cseries.py:        repo = pygit2.init_repository(self.gitdir)
> > tools/patman/cseries.py:        repo = pygit2.init_repository(self.gitdir)
> > tools/patman/cseries.py:        repo = pygit2.init_repository(self.gitdir)
>
> The patch covers exactly those :-)

Ah yes... :-)

Reviewed-by: Simon Glass <sjg at chromium.org>

Regards,
Simon


More information about the U-Boot mailing list