diff --git a/crates/worktree/src/worktree.rs b/crates/worktree/src/worktree.rs index 7af86d3364f6e07116ae701da83b897869bb905e..2db380fa2f0262142bfb124ce9c22b24efd99c0e 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 {