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

Method to_git_object_id

atomic-repository/src/git_binding/codec.rs:105–114  ·  view source on GitHub ↗

Convert into the algorithm-tagged core type for Git interop.

(&self)

Source from the content-addressed store, hash-verified

103
104 /// Convert into the algorithm-tagged core type for Git interop.
105 pub fn to_git_object_id(&self) -> Result<GitObjectId, BindingEncodeError> {
106 match self {
107 GitOid::Sha1(bytes) => {
108 GitObjectId::new(GitHashAlgorithm::Sha1, bytes.to_vec()).map_err(Into::into)
109 }
110 GitOid::Sha256(bytes) => {
111 GitObjectId::new(GitHashAlgorithm::Sha256, bytes.to_vec()).map_err(Into::into)
112 }
113 }
114 }
115
116 /// Raw digest bytes.
117 pub fn as_bytes(&self) -> &[u8] {

Calls

no outgoing calls