forked from mirrors/jj
cli: respect default value of git core.excludesFile
This commit is contained in:
parent
1a11679539
commit
b222bbd10a
1 changed files with 5 additions and 0 deletions
|
@ -584,6 +584,11 @@ impl WorkspaceCommandHelper {
|
|||
if let Ok(excludes_file_str) = self
|
||||
.git_config()
|
||||
.and_then(|git_config| git_config.get_string("core.excludesFile"))
|
||||
.or_else(|_| {
|
||||
std::env::var("XDG_CONFIG_HOME")
|
||||
.or_else(|_| std::env::var("HOME"))
|
||||
.map(|x| format!("{x}/.config/git/ignore"))
|
||||
})
|
||||
{
|
||||
let excludes_file_path = expand_git_path(excludes_file_str);
|
||||
git_ignores = git_ignores.chain_with_file("", excludes_file_path);
|
||||
|
|
Loading…
Reference in a new issue