From ed4037327b05632706450a86005a150d142b18f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jelmer=20Vernoo=C4=B3?= Date: Sat, 30 Nov 2019 17:53:13 +0000 Subject: [PATCH] Expand ~ in global exclude path. --- NEWS | 2 ++ dulwich/ignore.py | 7 +++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index e90c38151..12ca7bd3c 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,8 @@ * Cleanup new directory if clone fails. (Jelmer Vernooij, #733) + * Expand "~" in global exclude path. (Jelmer Vernooij) + 0.19.13 2019-08-19 BUG FIXES diff --git a/dulwich/ignore.py b/dulwich/ignore.py index 2bcfecc76..37a0d9ec8 100644 --- a/dulwich/ignore.py +++ b/dulwich/ignore.py @@ -271,9 +271,7 @@ def default_user_ignore_filter_path(config): except KeyError: pass - xdg_config_home = os.environ.get( - "XDG_CONFIG_HOME", os.path.expanduser("~/.config/"), - ) + xdg_config_home = os.environ.get("XDG_CONFIG_HOME", "~/.config/") return os.path.join(xdg_config_home, 'git', 'ignore') @@ -366,7 +364,8 @@ def from_repo(cls, repo): os.path.join(repo.controldir(), 'info', 'exclude'), default_user_ignore_filter_path(repo.get_config_stack())]: try: - global_filters.append(IgnoreFilter.from_path(p)) + global_filters.append( + IgnoreFilter.from_path(os.path.expanduser(p))) except IOError: pass config = repo.get_config_stack()