From 4dd463f8ac2b05014102bab1783f589cbb309948 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Fri, 17 Oct 2025 14:57:03 -0700 Subject: [PATCH] Fix repo path to project path conversion in git panel (#40535) Closes https://github.com/zed-industries/zed/issues/40422 Closes https://github.com/zed-industries/zed/issues/40379 Closes https://github.com/zed-industries/zed/issues/40307 Release Notes: - Fixed an issue where the project diff view did not work for multi-repo projects on Windows when using WSL or SSH remoting --- crates/project/src/git_store.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/crates/project/src/git_store.rs b/crates/project/src/git_store.rs index c58f7217a9bedab02f62337bb44d87aa5b7bbade..461b15ef5f84a22f2a666674e12d27f0ef341d99 100644 --- a/crates/project/src/git_store.rs +++ b/crates/project/src/git_store.rs @@ -2910,6 +2910,13 @@ impl RepositorySnapshot { Self::abs_path_to_repo_path_inner(&self.work_directory_abs_path, abs_path, self.path_style) } + fn repo_path_to_abs_path(&self, repo_path: &RepoPath) -> PathBuf { + self.path_style + .join(&self.work_directory_abs_path, repo_path.as_std_path()) + .unwrap() + .into() + } + #[inline] fn abs_path_to_repo_path_inner( work_directory_abs_path: &Path, @@ -3349,10 +3356,7 @@ impl Repository { pub fn repo_path_to_project_path(&self, path: &RepoPath, cx: &App) -> Option { let git_store = self.git_store.upgrade()?; let worktree_store = git_store.read(cx).worktree_store.read(cx); - let abs_path = self - .snapshot - .work_directory_abs_path - .join(path.as_std_path()); + let abs_path = self.snapshot.repo_path_to_abs_path(path); let abs_path = SanitizedPath::new(&abs_path); let (worktree, relative_path) = worktree_store.find_worktree(abs_path, cx)?; Some(ProjectPath {