{"record":{"id":"97a55b2e78510f7a","repo":"zed-industries/zed","slug":"failed-to-reset-n","errorCode":null,"errorMessage":"Failed to reset:\\n{}","messagePattern":"Failed to reset:\\\\n(.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/git/src/repository.rs","lineNumber":1513,"sourceCode":"                .stdin(Stdio::piped())\n                .stdout(Stdio::piped())\n                .stderr(Stdio::piped())\n                .spawn()\n                .context(\"starting git cat-file process\")?;\n\n            let mut files = Vec::<CommitFile>::new();\n            let stdin = cat_file_process\n                .stdin\n                .take()\n                .context(\"git cat-file process has no stdin\")?;\n            let stdout = cat_file_process\n                .stdout\n                .take()\n                .context(\"git cat-file process has no stdout\")?;\n            let mut stdin = BufWriter::with_capacity(512, stdin);\n            let mut stdout = BufReader::new(stdout);\n            let mut info_line = String::new();\n            let mut newline = [b'\\0'];\n            for change in changes {\n                let change = change?;\n                let path = change.path;\n                // git-show outputs `/`-delimited paths even on Windows.\n                let Some(rel_path) = RelPath::from_unix_str(path).log_err() else {\n                    continue;\n                };\n\n                let objects = [change.new_object, change.old_object];\n                let mut has_blobs = false;\n                for object in objects.iter().flatten() {\n                    if object.kind == CommitDiffObjectKind::Blob {\n                        stdin.write_all(object.oid.as_bytes()).await?;\n                        stdin.write_all(b\"\\n\").await?;\n                        has_blobs = true;\n                    }\n                }\n                if has_blobs {","sourceCodeStart":1495,"sourceCodeEnd":1531,"githubUrl":"https://github.com/zed-industries/zed/blob/5a9b9558db01a6b906cec2fb70a797affdc58cdd/crates/git/src/repository.rs#L1495-L1531","documentation":"The 'git reset --mixed/--soft <commit>' subprocess completed but exited non-zero; the error embeds git's output ({}). Reset failed due to repository state — unmerged index, index.lock held by another process, or an invalid commit ref — while spawning itself succeeded.","triggerScenarios":"Thrown at crates/git/src/repository.rs:1502 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the embedded git output: 'Unable to create index.lock' means another git process is running — retry after it finishes","For unmerged paths, resolve conflicts before resetting","Validate the commit ref exists in this repository before issuing the reset"],"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"}