Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Fix a panic when git askpass triggers during commit (#50057)
Conrad Irwincb793a4667c6
diff --git a/crates/git_ui/src/git_panel.rs b/crates/git_ui/src/git_panel.rsindex b8caf478305..fe7d8975010 100644--- a/crates/git_ui/src/git_panel.rs+++ b/crates/git_ui/src/git_panel.rs@@ -3171,18 +3171,16 @@ impl GitPanel {window: &mut Window,cx: &mut Context<Self>,) -> AskPassDelegate {- let this = cx.weak_entity();+ let workspace = self.workspace.clone();let operation = operation.into();let window = window.window_handle();AskPassDelegate::new(&mut cx.to_async(), move |prompt, tx, cx| {window.update(cx, |_, window, cx| {- this.update(cx, |this, cx| {- this.workspace.update(cx, |workspace, cx| {- workspace.toggle_modal(window, cx, |window, cx| {- AskPassModal::new(operation.clone(), prompt.into(), tx, window, cx)- });- })+ workspace.update(cx, |workspace, cx| {+ workspace.toggle_modal(window, cx, |window, cx| {+ AskPassModal::new(operation.clone(), prompt.into(), tx, window, cx)+ });})}).ok();