commit - fddeca05f88e0ebc397a2122bfa3c1eb77ca38a2
commit + bc10bc8f2bfb5bfb2a68b8c0ec1ea71863e6b4a7
blob - 81feb78ee5f3402d748c351071d28da3886741c9
blob + 19f540e69893a800afb90122765f0e02d003faf1
--- dulwich/client.py
+++ dulwich/client.py
except KeyError:
pass
for needle in needles:
- assert isinstance(needle, bytes)
yield needle.decode('utf-8'), replacement.decode('utf-8')
blob - d9dac555bef8dd3f0597019a1921987700f8b34b
blob + e52d468e3bc66f6fa295218061a2656e207ac800
--- dulwich/config.py
+++ dulwich/config.py
value = self.get(section, name)
except KeyError:
return default
- if isinstance(value, bool):
- return value
if value.lower() == b"true":
return True
elif value.lower() == b"false":
return self._values.keys()
-def _format_string(value):
+def _format_string(value: bytes) -> bytes:
if (
value.startswith(b" ")
or value.startswith(b"\t")
else:
f.write(b"[" + section_name + b' "' + subsection_name + b'"]\n')
for key, value in values.items():
- if value is True:
- value = b"true"
- elif value is False:
- value = b"false"
- else:
- value = _format_string(value)
+ value = _format_string(value)
f.write(b"\t" + key + b" = " + value + b"\n")