Skip to content

Commit 2fc56d4

Browse files
committed
fixed git status not working in directories containing '../'
1 parent 63a1035 commit 2fc56d4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/fs/feature/git.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ impl FromIterator<PathBuf> for GitCache {
5353
else {
5454
match GitRepo::discover(path) {
5555
Ok(r) => {
56-
if let Some(mut r2) = git.repos.iter_mut().find(|e| e.has_workdir(&r.workdir)) {
56+
if let Some(r2) = git.repos.iter_mut().find(|e| e.has_workdir(&r.workdir)) {
5757
debug!("Adding to existing repo (workdir matches with {:?})", r2.workdir);
5858
r2.extra_paths.push(r.original_path);
5959
continue;
@@ -268,7 +268,8 @@ fn reorient(path: &Path) -> PathBuf {
268268
match current_dir() {
269269
Err(_) => Path::new(".").join(&path),
270270
Ok(dir) => dir.join(&path),
271-
}
271+
}.canonicalize().unwrap() // errors can be ignored here because they only occur if
272+
// the path does not exist / a component is not a folder
272273
}
273274

274275
/// The character to display if the file has been modified, but not staged.

0 commit comments

Comments
 (0)