ok/jj
1
0
Fork 0
forked from mirrors/jj

working copy: don't assume that $HOME exists (it doesn't on Windows CI)

This commit is contained in:
Martin von Zweigbergk 2021-05-13 23:00:46 -07:00
parent c1060610bd
commit df175f549f

View file

@ -312,11 +312,12 @@ impl TreeState {
// library crate instead of depending on $HOME directly here. We should also
// have the caller (within the library crate) chain that the
// .jj/git/info/exclude file if we're inside a git-backed repo.
let home_dir = std::env::var("HOME");
let home_dir_path = PathBuf::from(home_dir.unwrap());
let mut git_ignore = GitIgnoreFile::empty();
git_ignore =
TreeState::try_chain_gitignore(&git_ignore, "", home_dir_path.join(".gitignore"));
if let Ok(home_dir) = std::env::var("HOME") {
let home_dir_path = PathBuf::from(home_dir);
git_ignore =
TreeState::try_chain_gitignore(&git_ignore, "", home_dir_path.join(".gitignore"));
}
let mut work = vec![(
DirRepoPath::root(),