From d5262acbd33b70fb676284991207fb24fa9ac895 Mon Sep 17 00:00:00 2001 From: Jeremy Retailleau Date: Wed, 2 Sep 2020 14:03:17 -0700 Subject: 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 --- git/repo/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'git/repo/base.py') 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 -- cgit v1.2.1