From 869f81a365e35fea806cd842adac911164b5a86d Mon Sep 17 00:00:00 2001 From: "zed-zippy[bot]" <234243425+zed-zippy[bot]@users.noreply.github.com> Date: Wed, 25 Feb 2026 06:08:03 +0000 Subject: [PATCH] Fix a panic when git askpass triggers during commit (#50057) (cherry-pick to preview) (#50059) Cherry-pick of #50057 to preview ---- Fixes ZED-597 Release Notes: - Fixed a panic when the askpass dialogue opened while committing. Co-authored-by: Conrad Irwin --- crates/git_ui/src/git_panel.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/crates/git_ui/src/git_panel.rs b/crates/git_ui/src/git_panel.rs index 830870db63a3377bd3fff07eee57f53b6ae87d44..ae3765214aaf7b1394a96ce52bbb0218e56b428f 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, ) -> 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();