From 21b58643fadb5d06d5896ab1b41be25b95d86875 Mon Sep 17 00:00:00 2001 From: Bennet Bo Fenner Date: Tue, 29 Oct 2024 12:27:30 +0100 Subject: [PATCH] vsc menu: Fix issue when switching branch while non-visible worktree is open (#19888) Fixes a regression introduced in #19755 Screenshot 2024-10-29 at 12 13 04 Co-Authored-by: Thorsten 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 --- crates/vcs_menu/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/vcs_menu/src/lib.rs b/crates/vcs_menu/src/lib.rs index 3ee289df0e..8f73153dd8 100644 --- a/crates/vcs_menu/src/lib.rs +++ b/crates/vcs_menu/src/lib.rs @@ -242,7 +242,7 @@ impl PickerDelegate for BranchListDelegate { BranchEntry::NewBranch { name: branch_name } => branch_name, }; let worktree = project - .worktrees(cx) + .visible_worktrees(cx) .next() .context("worktree disappeared")?; let repository = ProjectPath::root_path(worktree.read(cx).id());