{"record":{"id":"0248304ad2f23e85","repo":"zed-industries/zed","slug":"operation-was-canceled","errorCode":null,"errorMessage":"Operation was canceled","messagePattern":"Operation was canceled","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/git_ui/src/git_ui.rs","lineNumber":489,"sourceCode":"    fn confirm(&mut self, _: &Confirm, window: &mut Window, cx: &mut Context<Self>) {\n        let new_name = self.editor.read(cx).text(cx);\n        if new_name.is_empty() || new_name == self.current_branch.as_ref() {\n            cx.emit(DismissEvent);\n            return;\n        }\n\n        let repo = self.repo.clone();\n        let current_branch = self.current_branch.to_string();\n        cx.spawn(async move |_, cx| {\n            match repo\n                .update(cx, |repo, _| {\n                    repo.rename_branch(current_branch, new_name.clone())\n                })\n                .await\n            {\n                Ok(Ok(_)) => Ok(()),\n                Ok(Err(error)) => Err(error),\n                Err(_) => Err(anyhow!(\"Operation was canceled\")),\n            }\n        })\n        .detach_and_prompt_err(\"Failed to rename branch\", window, cx, |_, _, _| None);\n        cx.emit(DismissEvent);\n    }\n}\n\nimpl EventEmitter<DismissEvent> for RenameBranchModal {}\nimpl ModalView for RenameBranchModal {}\nimpl Focusable for RenameBranchModal {\n    fn focus_handle(&self, cx: &App) -> FocusHandle {\n        self.editor.focus_handle(cx)\n    }\n}\n\nimpl Render for RenameBranchModal {\n    fn render(&mut self, _: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {\n        v_flex()","sourceCodeStart":471,"sourceCodeEnd":507,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/git_ui/src/git_ui.rs#L471-L507","documentation":"Generic failure wrapper in the rename-branch confirm flow: repository.update(...rename_branch...) returned an Err (git refused or failed the rename, e.g. invalid branch name or ref collision), and this message carries the underlying error to the UI.","triggerScenarios":"Thrown at crates/git_ui/src/git_ui.rs:489 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-open the branch list and retry the rename; the operation may have been dismissed","Check the repository for pending git operations (`git status`) or locks (.git/index.lock)","Ensure the new branch name is valid and does not already exist","Perform the rename manually with `git branch -m <old> <new>`"],"exampleFix":null,"handlingStrategy":"try-catch","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"}