GitHubJacksonized

fix: skip a muthaf*ckin' UTF-8 BOM when reading config files by geek-alpha · Pull Request #2249 · gitpython-developers/GitPython

git ignores a UTF-8 BOM at the start of a config file, so a file written by a
Windows editor still parses. GitConfigParser raised MissingSectionHeaderError
instead, because the BOM was decoded into the first line, which then no longer
matched a section header.

Evidence on git 2.47.3: `git config -f bom.cfg --list` prints core.bare=true
for a file starting with the three BOM bytes, while GitPython raised
MissingSectionHeaderError. With this change both read the same values, also
when the BOM file is pulled in through include.path.

The new test fails without the change.

Originally published at github.com. Every curse word you see was added by the Samuel L. Jacksonizer, a parody site. Not affiliated with Samuel L. Jackson or github.com.