mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-30 22:34:13 +00:00
vsc menu: Fix issue when switching branch while non-visible worktree is open (#19888)
Fixes a regression introduced in #19755 <img width="935" alt="Screenshot 2024-10-29 at 12 13 04" src="https://github.com/user-attachments/assets/7699b8da-631d-4932-89a8-bc5d7f2546f1"> Co-Authored-by: Thorsten <thorsten@zed.dev> Release Notes: - Fixed an issue where the branch switcher would show an error, when opening a file outside of the project Co-authored-by: Thorsten <thorsten@zed.dev>
This commit is contained in:
parent
6a0bcca9ec
commit
21b58643fa
1 changed files with 1 additions and 1 deletions
|
@ -242,7 +242,7 @@ impl PickerDelegate for BranchListDelegate {
|
||||||
BranchEntry::NewBranch { name: branch_name } => branch_name,
|
BranchEntry::NewBranch { name: branch_name } => branch_name,
|
||||||
};
|
};
|
||||||
let worktree = project
|
let worktree = project
|
||||||
.worktrees(cx)
|
.visible_worktrees(cx)
|
||||||
.next()
|
.next()
|
||||||
.context("worktree disappeared")?;
|
.context("worktree disappeared")?;
|
||||||
let repository = ProjectPath::root_path(worktree.read(cx).id());
|
let repository = ProjectPath::root_path(worktree.read(cx).id());
|
||||||
|
|
Loading…
Reference in a new issue