summaryrefslogtreecommitdiff
path: root/git/repo/base.py
diff options
context:
space:
mode:
authorJeremy Retailleau <jeremy.retailleau@gmail.com>2020-09-02 14:03:17 -0700
committerJeremy Retailleau <jeremy.retailleau@gmail.com>2020-09-02 14:03:17 -0700
commitd5262acbd33b70fb676284991207fb24fa9ac895 (patch)
treef6fdc8665bd573c0907ebc6170642ca056789290 /git/repo/base.py
parent9766832e11cdd8afed16dfd2d64529c2ae9c3382 (diff)
downloadgitpython-d5262acbd33b70fb676284991207fb24fa9ac895.tar.gz
Add reference to repository to config.
This is necessary when working with conditional include sections as it requires the git directory or active branch name. https://git-scm.com/docs/git-config#_conditional_includes
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 591ccec5..2579a7d7 100644
--- a/git/repo/base.py
+++ b/git/repo/base.py
@@ -452,7 +452,7 @@ class Repo(object):
files = [self._get_config_path(f) for f in self.config_level]
else:
files = [self._get_config_path(config_level)]
- return GitConfigParser(files, read_only=True)
+ return GitConfigParser(files, read_only=True, repo=self)
def config_writer(self, config_level="repository"):
"""
@@ -467,7 +467,7 @@ class Repo(object):
system = system wide configuration file
global = user level configuration file
repository = configuration file for this repostory only"""
- return GitConfigParser(self._get_config_path(config_level), read_only=False)
+ return GitConfigParser(self._get_config_path(config_level), read_only=False, repo=self)
def commit(self, rev=None):
"""The Commit object for the specified revision