{"record":{"id":"ff3f2e84f323b4f3","repo":"zed-industries/zed","slug":"object-not-found","errorCode":null,"errorMessage":"object not found: {}","messagePattern":"object not found: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/git/src/repository.rs","lineNumber":3579,"sourceCode":"            Ok(parse_file_history_changed_files_output(\n                &stdout,\n                &paths,\n                &shallow_boundary_oids,\n            ))\n        }\n        .boxed()\n    }\n\n    fn commit_data_reader(&self) -> Result<CommitDataReader> {\n        let git_binary = self.git_binary();\n\n        let (request_tx, request_rx) = async_channel::bounded::<CommitDataRequest>(64);\n\n        let task = self.executor.spawn(async move {\n            if let Err(error) = run_commit_data_reader(git_binary, request_rx).await {\n                log::error!(\"commit data reader failed: {error:?}\");\n            }\n        });\n\n        Ok(CommitDataReader {\n            request_tx,\n            _task: task,\n        })\n    }\n\n    fn set_trusted(&self, trusted: bool) {\n        self.is_trusted\n            .store(trusted, std::sync::atomic::Ordering::Release);\n    }\n\n    fn is_trusted(&self) -> bool {\n        self.is_trusted.load(std::sync::atomic::Ordering::Acquire)\n    }\n}\n\nasync fn run_commit_data_reader(","sourceCodeStart":3561,"sourceCodeEnd":3597,"githubUrl":"https://github.com/zed-industries/zed/blob/5a9b9558db01a6b906cec2fb70a797affdc58cdd/crates/git/src/repository.rs#L3561-L3597","documentation":"While reading a cat-file --batch response, git answered `<sha> missing`: the object does not exist in the local repository. It was never fetched, was pruned, or the SHA is wrong — this is git stating the object is absent, not a parse failure.","triggerScenarios":"Batch-loading commit data for a SHA that is not in the local object store: shallow clones (object beyond the graft depth), objects pruned by `git gc`, SHAs that exist only on an unfetched remote, or mistyped/truncated SHAs.","commonSituations":"Opening permalinks or pasted SHAs against a shallow clone; long-lived sessions after a background `git gc --prune` removed unreachable objects; multi-remote projects where the SHA lives only on a remote that is not configured locally.","solutions":["Fetch the object: `git fetch <remote> <sha>` (requires uploadpack.allowAnySHA1InWant on the server) or fetch the containing ref.","For shallow clones, deepen or unshallow the repository.","Pre-validate external SHAs with `git cat-file -e <sha> ^{commit}` and skip objects that are absent.","Do not persist SHAs that only exist via reflog or unreachable objects."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"fn object_exists(git: &GitBinary, sha: &str) -> impl Future<Output = bool> + '_ {\n    async move {\n        git.run(&[\"cat-file\", \"-e\", sha]).await.is_ok()\n    }\n}\n\nlet loadable: Vec<_> = shas.iter().filter(|s| object_exists(git, s).await).collect();","typeGuard":null,"tryCatchPattern":"match load_commits(&shas).await {\n    Err(e) if e.to_string().contains(\"object not found\") => {\n        // missing objects are expected for shallow/pruned clones: skip them or fetch first\n    }\n    other => other?,\n}","preventionTips":["Treat external SHAs as untrusted: verify presence with `git cat-file -e` before use.","Unshallow clones when full history is required.","Avoid depending on reflog-only or unreachable objects; gc can remove them at any time."],"tags":["git","cat-file","missing-object","shallow-clone"],"backgroundTag":"git-object-missing","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"}