(oid: &GitObjectId)
| 657 | } |
| 658 | |
| 659 | fn to_git2_oid(oid: &GitObjectId) -> Result<git2::Oid, ProjectionCommitError> { |
| 660 | if oid.algorithm() != GitHashAlgorithm::Sha1 { |
| 661 | return Err(ProjectionCommitError::Git(format!( |
| 662 | "libgit2 cannot address {:?} object ids", |
| 663 | oid.algorithm() |
| 664 | ))); |
| 665 | } |
| 666 | git2::Oid::from_bytes(oid.as_bytes()).map_err(git_error) |
| 667 | } |
| 668 | |
| 669 | pub(super) fn hex_oid(oid: &GitObjectId) -> String { |
| 670 | oid.as_bytes() |