{"record":{"id":"30d72853cb6bbf72","repo":"zed-industries/zed","slug":"failed-to-stash","errorCode":null,"errorMessage":"Failed to stash:\n{}","messagePattern":"Failed to stash:\n(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/git/src/repository.rs","lineNumber":2574,"sourceCode":"            .boxed()\n    }\n\n    fn stage_paths(\n        &self,\n        paths: Vec<RepoPath>,\n        env: Arc<HashMap<String, String>>,\n    ) -> BoxFuture<'_, Result<()>> {\n        let git = self.git_binary_in_worktree();\n        self.executor\n            .spawn(async move {\n                let git = git?;\n                if !paths.is_empty() {\n                    let output = git\n                        .build_command(&[\"update-index\", \"--add\", \"--remove\", \"--\"])\n                        .envs(env.iter())\n                        .args(paths.iter().map(|p| p.as_unix_str()))\n                        .output()\n                        .await?;\n                    anyhow::ensure!(\n                        output.status.success(),\n                        \"Failed to stage paths:\\n{}\",\n                        String::from_utf8_lossy(&output.stderr),\n                    );\n                }\n                Ok(())\n            })\n            .boxed()\n    }\n\n    fn unstage_paths(\n        &self,\n        paths: Vec<RepoPath>,\n        env: Arc<HashMap<String, String>>,\n    ) -> BoxFuture<'_, Result<()>> {\n        let git = self.git_binary_in_worktree();\n","sourceCodeStart":2556,"sourceCodeEnd":2592,"githubUrl":"https://github.com/zed-industries/zed/blob/5a9b9558db01a6b906cec2fb70a797affdc58cdd/crates/git/src/repository.rs#L2556-L2592","documentation":"ensure! guard failing when `git stash push --quiet --include-untracked` exits non-zero. The stash was not created; typical causes are no local changes to stash, merge conflicts, or index lock contention.","triggerScenarios":"Thrown at crates/git/src/repository.rs:2560 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read git stderr from the error ('No local changes to save' is benign — treat as no-op)","Check for .git/index.lock and remove if stale","Ensure no interactive merge state blocks stashing","If a custom message was supplied, verify it doesn't conflict with git argument parsing"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5a9b9558db01a6b906cec2fb70a797affdc58cdd","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}