mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-07-16 22:42:20 +02:00
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.
This commit is contained in:
committed by
Andrew Gallant
parent
72e3c54e0a
commit
6e209b6fdb
@ -454,7 +454,7 @@ fn gitconfig_contents() -> Option<Vec<u8>> {
|
|||||||
fn excludes_file_default() -> Option<PathBuf> {
|
fn excludes_file_default() -> Option<PathBuf> {
|
||||||
env::var_os("XDG_CONFIG_HOME")
|
env::var_os("XDG_CONFIG_HOME")
|
||||||
.and_then(|x| if x.is_empty() { None } else { Some(PathBuf::from(x)) })
|
.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"))
|
.map(|x| x.join("git/ignore"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user