Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Fix git staging in a subfolder (#37860)

localccf39729464052
diff --git a/crates/worktree/src/worktree.rs b/crates/worktree/src/worktree.rs
index 7af86d3364f..2db380fa2f0 100644
--- a/crates/worktree/src/worktree.rs
+++ b/crates/worktree/src/worktree.rs
@@ -4777,8 +4777,10 @@ impl BackgroundScanner {
.git_repositories
.iter()
.find_map(|(_, repo)| {
- if repo.common_dir_abs_path.as_ref() == &dot_git_dir
- || repo.repository_dir_abs_path.as_ref() == &dot_git_dir
+ let dot_git_dir = SanitizedPath::new(&dot_git_dir);
+ if SanitizedPath::new(repo.common_dir_abs_path.as_ref()) == dot_git_dir
+ || SanitizedPath::new(repo.repository_dir_abs_path.as_ref())
+ == dot_git_dir
{
Some(repo.clone())
} else {