{"record":{"id":"487875ad039ab1b1","repo":"zed-industries/zed","slug":"failed-to-stash-staged-changes-requires-git-2-35","errorCode":null,"errorMessage":"Failed to stash staged changes (requires git 2.35 or newer):\n{}","messagePattern":"Failed to stash staged changes \\(requires git 2\\.35 or newer\\):\n(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/git/src/repository.rs","lineNumber":2601,"sourceCode":"            .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\n        self.executor\n            .spawn(async move {\n                let git = git?;\n                if !paths.is_empty() {\n                    let output = git\n                        .build_command(&[\"reset\", \"--quiet\", \"--\"])\n                        .envs(env.iter())\n                        .args(paths.iter().map(|p| p.as_std_path()))\n                        .output()\n                        .await?;\n\n                    anyhow::ensure!(\n                        output.status.success(),\n                        \"Failed to unstage:\\n{}\",\n                        String::from_utf8_lossy(&output.stderr),\n                    );\n                }\n                Ok(())\n            })\n            .boxed()\n    }\n\n    fn stash_paths(\n        &self,\n        paths: Vec<RepoPath>,\n        message: Option<String>,\n        env: Arc<HashMap<String, String>>,","sourceCodeStart":2583,"sourceCodeEnd":2619,"githubUrl":"https://github.com/zed-industries/zed/blob/5a9b9558db01a6b906cec2fb70a797affdc58cdd/crates/git/src/repository.rs#L2583-L2619","documentation":"ensure! guard failing when `git stash push --quiet --staged` exits non-zero. The `--staged` flag requires git 2.35+, so it also fires on older git installations where the option is unrecognized; otherwise causes mirror ordinary stash push failures.","triggerScenarios":"Thrown at crates/git/src/repository.rs:2587 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Detect 'unknown option' or usage errors in stderr and surface a git-version upgrade requirement to the user","Check `git --version` and gate the feature on >= 2.35","Handle 'No local changes to save' as a benign no-op","Clear stale .git/index.lock before retrying"],"exampleFix":null,"handlingStrategy":"validation","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-14T00:17:10.932Z"}