Closed DaveLak closed 5 months ago
I've suggested a small change that I think improves clarity.
Separately from the changes here but relevant to the logic they are a part of, I'm a bit worried about the case where there are two (or more) trailing backslashes, so that removing one of them still leaves a trailing backslash. However, that was present before, and this PR definitely need not be expanded to address it! I'm also not certain I'm right to be worried about that; maybe it is less important to cover, or a part of a separate class of malformed configuration file inputs that are intended to trigger decoding errors.
Thanks for taking another look - admittedly I forgot to merge this PR. Cygwin is the bane of this CI as it takes unnatural amounts of time :/.
Having worked on the gitoxide
version of this I can say that this implementation here is more hole than cheese (if that makes sense :)), but it seems to work well enough for the common cases, still. Since GitPython is in maintenance mode, I don't think there is any need to try to improve it beyond fixing bugs.
Fixes: https://github.com/gitpython-developers/GitPython/issues/1887
Improve the guarding
if
check inGitConfigParser
'sstring_decode
function to safely handle empty strings and preventIndexError
s when accessing string elements.This resolves an IndexError in the
GitConfigParser
's.read()
method when the config file contains a quoted value ending with a new line.