From 80d43111b6bb73008683ad2f5a7c6abbab3c74ed Mon Sep 17 00:00:00 2001 From: Mihyaeru Date: Mon, 6 Jul 2015 21:00:54 +0900 Subject: fix(config): care tilde in include.path config --- git/config.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'git/config.py') diff --git a/git/config.py b/git/config.py index 2d9adbdd..b5e1fbab 100644 --- a/git/config.py +++ b/git/config.py @@ -386,6 +386,8 @@ class GitConfigParser(with_metaclass(MetaParserBuilder, cp.RawConfigParser, obje # We expect all paths to be normalized and absolute (and will assure that is the case) if self._has_includes(): for _, include_path in self.items('include'): + if '~' in include_path: + include_path = os.path.expanduser(include_path) if not os.path.isabs(include_path): if not close_fp: continue -- cgit v1.2.1 From 1578baf817c2526d29276067d2f23d28b6fab2b1 Mon Sep 17 00:00:00 2001 From: Mihyaeru Date: Mon, 6 Jul 2015 22:43:47 +0900 Subject: fix(config): use `str.startswith('~')` instead of `'~' in str` --- git/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git/config.py') diff --git a/git/config.py b/git/config.py index b5e1fbab..b7ddf0d2 100644 --- a/git/config.py +++ b/git/config.py @@ -386,7 +386,7 @@ class GitConfigParser(with_metaclass(MetaParserBuilder, cp.RawConfigParser, obje # We expect all paths to be normalized and absolute (and will assure that is the case) if self._has_includes(): for _, include_path in self.items('include'): - if '~' in include_path: + if include_path.startswith('~'): include_path = os.path.expanduser(include_path) if not os.path.isabs(include_path): if not close_fp: -- cgit v1.2.1