Use correct worktree when getting permalink to line (#8888)
Previously this code would call `project.visible_worktrees(cx).next` which might not necessarily return the worktree matching the currently open file. What this change does is it adds `get_repo` method on `Project` that allows us to get the `GitRepository` for the current buffer. Release Notes: - Fixed `open permalink to line` not working when multiple folders are added to the project. Co-authored-by: Mikayla <mikayla@zed.dev>
This commit is contained in:
parent
d286c56ebb
commit
2b8b913b6b
3 changed files with 34 additions and 22 deletions
|
@ -2116,6 +2116,11 @@ impl LocalSnapshot {
|
|||
Some((path, self.git_repositories.get(&repo.work_directory_id())?))
|
||||
}
|
||||
|
||||
pub fn local_git_repo(&self, path: &Path) -> Option<Arc<Mutex<dyn GitRepository>>> {
|
||||
self.local_repo_for_path(path)
|
||||
.map(|(_, entry)| entry.repo_ptr.clone())
|
||||
}
|
||||
|
||||
fn build_update(
|
||||
&self,
|
||||
project_id: u64,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue