mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-05-19 09:40:22 -07:00
Use env::home_dir() instead of env::var_os(HOME).
Thanks @steveklabnik!
This commit is contained in:
parent
39e1a0d694
commit
a3f5e0c3d5
@ -453,9 +453,9 @@ fn gitconfig_contents() -> Option<Vec<u8>> {
|
|||||||
/// Specifically, this respects XDG_CONFIG_HOME.
|
/// Specifically, this respects XDG_CONFIG_HOME.
|
||||||
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(x) })
|
.and_then(|x| if x.is_empty() { None } else { Some(PathBuf::from(x)) })
|
||||||
.or_else(|| env::var_os("HOME"))
|
.or_else(|| env::home_dir())
|
||||||
.map(|x| PathBuf::from(x).join("git/ignore"))
|
.map(|x| x.join("git/ignore"))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Extract git's `core.excludesfile` config setting from the raw file contents
|
/// Extract git's `core.excludesfile` config setting from the raw file contents
|
||||||
|
Loading…
x
Reference in New Issue
Block a user