GitPython
GitPython copied to clipboard
GitConfigParser doesn't handle multiple includes
When more than a single include is listed in the git configuration file, the parser only picks up the last one.
Reproducer:
gitconfig.example
[include]
path = ~/.gitconfig.local
[include]
path = ~/.gitconfig.os
from git import GitConfigParser
p = GitConfigParser("/home/lkollar/gitconfig.example")
p.read()
print(p.items("include"))
$ python test_gitpython.py
[('path', '~/.gitconfig.os')]
Tested with 3.1.27.
Thanks for letting me know and for the reproducer as well.
This should definitely work, and trying to fix it is likely to uncover more issues with the shoddy way this is currently implemented (based on the INI parser, I believe), in case someone wants to give it a shot.