MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / to_git2_oid

Function to_git2_oid

atomic-repository/src/repository/projection_commit.rs:659–667  ·  view source on GitHub ↗
(oid: &GitObjectId)

Source from the content-addressed store, hash-verified

657}
658
659fn 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
669pub(super) fn hex_oid(oid: &GitObjectId) -> String {
670 oid.as_bytes()

Calls 3

GitClass · 0.85
algorithmMethod · 0.45
as_bytesMethod · 0.45