{"record":{"id":"9a60723ed7f08e2a","repo":"zed-industries/zed","slug":"failed-to-checkout-files-n","errorCode":null,"errorMessage":"Failed to checkout files:\\n{}","messagePattern":"Failed to checkout files:\\\\n(.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/git/src/repository.rs","lineNumber":1542,"sourceCode":"                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 {\n                    stdin.flush().await?;\n                }\n\n                let [new_object, old_object] = objects;\n                let new_object =\n                    load_commit_object(new_object, &mut stdout, &mut info_line, &mut newline)\n                        .await?;\n                let old_object =\n                    load_commit_object(old_object, &mut stdout, &mut info_line, &mut newline)\n                        .await?;\n                let is_binary = new_object.as_ref().is_some_and(|object| object.is_binary)\n                    || old_object.as_ref().is_some_and(|object| object.is_binary);\n                let new_content = new_object.map(|object| object.content);\n                let old_content = old_object.map(|object| object.content);\n\n                files.push(CommitFile {\n                    path: RepoPath(Arc::from(rel_path)),\n                    old_content,\n                    new_content,\n                    is_binary,\n                })\n            }\n\n            Ok(CommitDiff {\n                files,\n                is_shallow_boundary: false,\n            })\n        })\n        .boxed()","sourceCodeStart":1524,"sourceCodeEnd":1560,"githubUrl":"https://github.com/zed-industries/zed/blob/5a9b9558db01a6b906cec2fb70a797affdc58cdd/crates/git/src/repository.rs#L1524-L1560","documentation":"The 'git checkout <commit> -- <paths>' subprocess used to restore specific files exited non-zero; git's stderr is embedded in the message. Common causes: the requested paths no longer exist in that commit, pathspec matched nothing, or the worktree/index is locked — the file restore could not be performed.","triggerScenarios":"Thrown at crates/git/src/repository.rs:1531 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the embedded stderr: 'pathspec did not match' means the file is absent in the target commit — filter such paths first","Retry when the failure is index.lock contention from a concurrent git process","Verify the paths' RepoPath spellings match the commit's tree entries"],"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-14T00:17:10.932Z"}