Skip to content

Commit

Permalink
Look for global git/ignore in ~/.config/git, not ~/git
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
blueyed authored and BurntSushi committed Jan 30, 2017
1 parent 72e3c54 commit 6e209b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ignore/src/gitignore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}

Expand Down

0 comments on commit 6e209b6

Please sign in to comment.