From 2fc56d45ca1074f3135f16e35f53646f8262191f Mon Sep 17 00:00:00 2001 From: Lukas Rysavy Date: Fri, 13 Apr 2018 22:23:46 +0200 Subject: fixed git status not working in directories containing '../' --- src/fs/feature/git.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/fs/feature/git.rs b/src/fs/feature/git.rs index 9cc1b7f..0864a5e 100644 --- a/src/fs/feature/git.rs +++ b/src/fs/feature/git.rs @@ -53,7 +53,7 @@ impl FromIterator for GitCache { else { match GitRepo::discover(path) { Ok(r) => { - if let Some(mut r2) = git.repos.iter_mut().find(|e| e.has_workdir(&r.workdir)) { + if let Some(r2) = git.repos.iter_mut().find(|e| e.has_workdir(&r.workdir)) { debug!("Adding to existing repo (workdir matches with {:?})", r2.workdir); r2.extra_paths.push(r.original_path); continue; @@ -268,7 +268,8 @@ fn reorient(path: &Path) -> PathBuf { match current_dir() { Err(_) => Path::new(".").join(&path), Ok(dir) => dir.join(&path), - } + }.canonicalize().unwrap() // errors can be ignored here because they only occur if + // the path does not exist / a component is not a folder } /// The character to display if the file has been modified, but not staged. -- cgit v1.2.3