(&self, oid: &GitObjectId)
| 954 | } |
| 955 | |
| 956 | fn verified_blob(&self, oid: &GitObjectId) -> Result<Vec<u8>, ProjectTreeError> { |
| 957 | let object = self |
| 958 | .objects |
| 959 | .get(oid) |
| 960 | .ok_or_else(|| ProjectTreeError::MissingGitObject(oid.clone()))?; |
| 961 | if object.kind != GitObjectKind::Blob |
| 962 | || git_object_id(oid.algorithm(), object.kind, &object.bytes)? != *oid |
| 963 | { |
| 964 | return Err(ProjectTreeError::MalformedGitTree( |
| 965 | "blob object identity or kind mismatch".into(), |
| 966 | )); |
| 967 | } |
| 968 | Ok(object.bytes.to_vec()) |
| 969 | } |
| 970 | } |
| 971 | |
| 972 | /// Atomic projection result: canonical manifest and the equivalent Git tree. |
no test coverage detected