Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork938
Open
Description
If the.gitconfig
file includes anincludeIf
directive, the config parser doesn't respect it.
~/.gitconfig
file contents:
[includeIf "gitdir:~/work/git/"] path = ~/.gitconfig.work[user] email = my@email.com name = Me useconfigonly = true
~/.gitconfig.work
contents
[user] email: work@email.com name = Work
Change to the~/work/git/project
directory and rungit config -l
and notice that the name is set toWork
. Running the following in a Python REPL
import osfrom git import Reporepo = Repo(os.getcwd())repo.repo.config_reader().get_value("user", "name")'Me'
And if the user hasn't got a default user setting in the~/gitconfig
file, it will throwConfigParser.NoSectionError: No section: 'user'
which is expected.
Config parser should support theincludeIf
directive in the config file.