{"record":{"id":"ae7eb5d056b59e78","repo":"zed-industries/zed","slug":"no-active-repository-ae7eb5","errorCode":null,"errorMessage":"No active repository","messagePattern":"No active repository","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/git_ui/src/branch_diff.rs","lineNumber":91,"sourceCode":"        workspace.register_action(|workspace, _: &DeployBranchDiff, window, cx| {\n            Self::deploy_branch_diff(workspace, window, cx)\n        });\n        workspace.register_action(Self::compare_with_branch);\n        workspace::register_serializable_item::<Self>(cx);\n    }\n\n    pub(crate) fn deploy_branch_diff(\n        workspace: &mut Workspace,\n        window: &mut Window,\n        cx: &mut Context<Workspace>,\n    ) {\n        telemetry::event!(\"Git Branch Diff Opened\");\n        let project = workspace.project().clone();\n        let Some(intended_repo) = project.read(cx).active_repository(cx) else {\n            let workspace = cx.entity().downgrade();\n            window\n                .spawn(cx, async |_cx| {\n                    let result: Result<()> = Err(anyhow!(\"No active repository\"));\n                    result\n                })\n                .detach_and_notify_err(workspace, window, cx);\n            return;\n        };\n\n        let default_branch = intended_repo.update(cx, |repo, _| repo.default_branch(true));\n        let workspace = cx.entity();\n        let workspace_weak = workspace.downgrade();\n        window\n            .spawn(cx, async move |cx| {\n                let base_ref = default_branch.await??;\n                workspace.update_in(cx, |workspace, window, cx| {\n                    let git_store = project.read(cx).git_store().clone();\n                    let Some(base_ref) = base_ref else {\n                        ProjectDiff::deploy_at(workspace, None, window, cx);\n                        return;\n                    };","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/git_ui/src/branch_diff.rs#L73-L109","documentation":"In BranchDiffView::deploy_branch_diff: the action was invoked but project.read(cx).active_repository() returned None, so there is no repository to compute the branch diff for. This happens when the diff action is dispatched with no active project repository.","triggerScenarios":"Thrown at crates/git_ui/src/branch_diff.rs:91 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Exit early without deploying the branch diff view","Optionally show a 'no repository' status toast to explain the no-op","Ensure the action is only registered/dispatched in workspaces containing git repositories"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}