summaryrefslogtreecommitdiff
path: root/git/repo/base.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2015-01-14 12:46:51 +0100
committerSebastian Thiel <byronimo@gmail.com>2015-01-14 12:46:51 +0100
commit619c989915b568e4737951fafcbae14cd06d6ea6 (patch)
tree3dde760f0018eb418a8c2bb9f0587dc42f74e680 /git/repo/base.py
parentbe074c655ad53927541fc6443eed8b0c2550e415 (diff)
downloadgitpython-619c989915b568e4737951fafcbae14cd06d6ea6.tar.gz
GitConfigParser now respects and merges 'include' sections
We implement it as described in this article: http://stackoverflow.com/questions/1557183/is-it-possible-to-include-a-file-in-your-gitconfig Thus we handle * cycles * relative and absolute include paths * write-backs in case of writable GitConfigParser instances Fixes #201
Diffstat (limited to 'git/repo/base.py')
-rw-r--r--git/repo/base.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/git/repo/base.py b/git/repo/base.py
index f5ed2479..155a674f 100644
--- a/git/repo/base.py
+++ b/git/repo/base.py
@@ -359,11 +359,11 @@ class Repo(object):
return "/etc/gitconfig"
elif config_level == "user":
config_home = os.environ.get("XDG_CONFIG_HOME") or os.path.join(os.environ.get("HOME", '~'), ".config")
- return os.path.expanduser(join(config_home, "git", "config"))
+ return os.path.normpath(os.path.expanduser(join(config_home, "git", "config")))
elif config_level == "global":
return os.path.normpath(os.path.expanduser("~/.gitconfig"))
elif config_level == "repository":
- return join(self.git_dir, "config")
+ return os.path.normpath(join(self.git_dir, "config"))
raise ValueError("Invalid configuration level: %r" % config_level)