From d5bba4cc47cfac0dd3ae42f326bae4c490dc540b Mon Sep 17 00:00:00 2001 From: Smit Barmase Date: Mon, 8 Jun 2026 23:03:04 +0530 Subject: [PATCH] git_ui: Fix panic when splitting a pane containing a commit view (#58853) Closes FR-65 Release Notes: - Fixed a crash when splitting a pane containing a commit view. --- crates/git_ui/src/commit_view.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/git_ui/src/commit_view.rs b/crates/git_ui/src/commit_view.rs index 7dc93157c8..353deb47ed 100644 --- a/crates/git_ui/src/commit_view.rs +++ b/crates/git_ui/src/commit_view.rs @@ -82,6 +82,7 @@ pub struct CommitView { stash: Option, multibuffer: Entity, repository: Entity, + project: Entity, workspace: WeakEntity, remote: Option, } @@ -471,6 +472,7 @@ impl CommitView { multibuffer, stash, repository, + project, workspace, remote, } @@ -1173,7 +1175,7 @@ impl Item for CommitView { let Some(workspace_entity) = self.workspace.upgrade() else { return Task::ready(None); }; - let project = workspace_entity.read(cx).project().clone(); + let project = self.project.clone(); let diff_view_style = self.editor.read(cx).diff_view_style(); let multibuffer = self.multibuffer.clone(); Task::ready(Some(cx.new(|cx| { @@ -1223,6 +1225,7 @@ impl Item for CommitView { commit: self.commit.clone(), stash: self.stash, repository: self.repository.clone(), + project: self.project.clone(), workspace: self.workspace.clone(), remote: self.remote.clone(), }