Skip to content

Commit ac24e77

Browse files
committed
chore: fix mypy error with new pygit2 release
See libgit2/pygit2#1457. Now, pygit2 returns None for valueless boolean entries, instead of failing. Dulwich returns "true" in this case, so do the same here to avoid discrepancies between the two backends. ```ini [some-section "identifier"] booleanflag ```
1 parent ce718e4 commit ac24e77

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/scmrepo/git/backend/pygit2/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ def _key(self, section: tuple[str, ...], name: str) -> str:
118118
return ".".join((*section, name))
119119

120120
def get(self, section: tuple[str, ...], name: str) -> str:
121-
return self._config[self._key(section, name)]
121+
k = self._config[self._key(section, name)]
122+
return "true" if k is None else k
122123

123124
def get_bool(self, section: tuple[str, ...], name: str) -> bool:
124125
from pygit2 import GitError

0 commit comments

Comments
 (0)