From 80d43111b6bb73008683ad2f5a7c6abbab3c74ed Mon Sep 17 00:00:00 2001 From: Mihyaeru Date: Mon, 6 Jul 2015 21:00:54 +0900 Subject: [PATCH 1/2] fix(config): care tilde in include.path config --- git/config.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/git/config.py b/git/config.py index 2d9adbdd9..b5e1fbab2 100644 --- a/git/config.py +++ b/git/config.py @@ -386,6 +386,8 @@ def read(self): # 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 From 1578baf817c2526d29276067d2f23d28b6fab2b1 Mon Sep 17 00:00:00 2001 From: Mihyaeru Date: Mon, 6 Jul 2015 22:43:47 +0900 Subject: [PATCH 2/2] fix(config): use `str.startswith('~')` instead of `'~' in str` --- git/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git/config.py b/git/config.py index b5e1fbab2..b7ddf0d22 100644 --- a/git/config.py +++ b/git/config.py @@ -386,7 +386,7 @@ def read(self): # 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: