GitPython icon indicating copy to clipboard operation
GitPython copied to clipboard

GitConfigParser doesn't handle multiple includes

Open lkollar opened this issue 3 years ago • 1 comments

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.

lkollar avatar Mar 28 '22 09:03 lkollar

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.

Byron avatar Mar 28 '22 23:03 Byron