You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In case if I want to check if branch was provided to submodule and it is not provided I got error
if sm.branch:
name = f"{sm.branch}/{sm.name}"
else:
name = f"{sm.name}"
File "/app/venv/lib/python3.11/site-packages/pygit2/submodules.py", line 148, in branch return ffi.string(branch).decode('utf-8') ^^^^^^^^^^^^^^^^^^ RuntimeError: cannot use string() on <cdata 'char *' NULL>
It looks like there is missing check if branch is actually set
class Submodule:
...
@property
def branch(self):
"""Branch that is to be tracked by the submodule."""
branch = C.git_submodule_branch(self._subm)
return ffi.string(branch).decode('utf-8')
I think it should be like this
@property
def branch(self):
"""Branch that is to be tracked by the submodule."""
branch = C.git_submodule_branch(self._subm)
if branch:
return ffi.string(branch).decode('utf-8')
The text was updated successfully, but these errors were encountered:
In case if I want to check if branch was provided to submodule and it is not provided I got error
File "/app/venv/lib/python3.11/site-packages/pygit2/submodules.py", line 148, in branch return ffi.string(branch).decode('utf-8') ^^^^^^^^^^^^^^^^^^ RuntimeError: cannot use string() on <cdata 'char *' NULL>
It looks like there is missing check if branch is actually set
class Submodule:
...
I think it should be like this
The text was updated successfully, but these errors were encountered: