Skip to content

Commit

Permalink
Expand ~ in global exclude path.
Browse files Browse the repository at this point in the history
  • Loading branch information
jelmer committed Nov 30, 2019
1 parent acdc0ac commit ed40373
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions dulwich/ignore.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')


Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit ed40373

Please sign in to comment.