summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2017-01-29 16:30:56 +0100
committerAndrew Gallant <jamslam@gmail.com>2017-01-30 16:58:58 -0500
commit6e209b6fdbd8e3f062793f946cc7b55c2ed958f2 (patch)
treee89f996fe49786354c14908268bf2c69f648458a
parent72e3c54e0af539c3c6b6d7b872a295884c7e97bd (diff)
Look for global git/ignore in ~/.config/git, not ~/git
The documentation says: > If `$XDG_CONFIG_HOME` is not set or is empty, then > `$HOME/.config/git/ignore` is used instead. This is the expected behavior, but the code looked at ~/git/ignore instead.
-rw-r--r--ignore/src/gitignore.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/ignore/src/gitignore.rs b/ignore/src/gitignore.rs
index 6a0bc969..7e547c2c 100644
--- a/ignore/src/gitignore.rs
+++ b/ignore/src/gitignore.rs
@@ -454,7 +454,7 @@ fn gitconfig_contents() -> Option<Vec<u8>> {
fn excludes_file_default() -> Option<PathBuf> {
env::var_os("XDG_CONFIG_HOME")
.and_then(|x| if x.is_empty() { None } else { Some(PathBuf::from(x)) })
- .or_else(|| env::home_dir())
+ .or_else(|| env::home_dir().map(|p| p.join(".config")))
.map(|x| x.join("git/ignore"))
}