[PATCH] patman: fix use in worktree

Ludwig Nussel ludwig.nussel at siemens.com
Tue May 5 10:25:03 CEST 2026


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.

cu
Ludwig

-- 
Ludwig Nussel
Siemens AG
www.siemens.com


More information about the U-Boot mailing list