mirror of
https://github.com/zed-industries/zed.git
synced 2024-09-19 10:29:35 +03:00
branch_list: Bail in case of missing worktrees. (#2726)
Z-2632 Release Notes: - Fixed a crash that occurred when opening a modal branch picker without a corktree.
This commit is contained in:
commit
369ccc725c
@ -106,12 +106,14 @@ impl PickerDelegate for BranchListDelegate {
|
|||||||
.read_with(&mut cx, |view, cx| {
|
.read_with(&mut cx, |view, cx| {
|
||||||
let delegate = view.delegate();
|
let delegate = view.delegate();
|
||||||
let project = delegate.workspace.read(cx).project().read(&cx);
|
let project = delegate.workspace.read(cx).project().read(&cx);
|
||||||
let mut cwd =
|
|
||||||
project
|
let Some(worktree) = project
|
||||||
.visible_worktrees(cx)
|
.visible_worktrees(cx)
|
||||||
.next()
|
.next()
|
||||||
.unwrap()
|
else {
|
||||||
.read(cx)
|
bail!("Cannot update branch list as there are no visible worktrees")
|
||||||
|
};
|
||||||
|
let mut cwd = worktree .read(cx)
|
||||||
.abs_path()
|
.abs_path()
|
||||||
.to_path_buf();
|
.to_path_buf();
|
||||||
cwd.push(".git");
|
cwd.push(".git");
|
||||||
|
Loading…
Reference in New Issue
Block a user