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

Function to_git2_oid

atomic-cli/src/commands/git/shadow.rs:1755–1765  ·  view source on GitHub ↗
(oid: &atomic_core::operation::GitObjectId)

Source from the content-addressed store, hash-verified

1753}
1754
1755fn to_git2_oid(oid: &atomic_core::operation::GitObjectId) -> CliResult<git2::Oid> {
1756 use atomic_core::operation::GitHashAlgorithm;
1757 if oid.algorithm() != GitHashAlgorithm::Sha1 {
1758 return Err(git_error(format!(
1759 "libgit2 cannot address {:?} object ids",
1760 oid.algorithm()
1761 )));
1762 }
1763 git2::Oid::from_bytes(oid.as_bytes())
1764 .map_err(|error| git_error(format!("invalid projected Git oid: {error}")))
1765}
1766
1767/// The algorithm-tagged core identity of a libgit2 object id.
1768fn to_core_oid(oid: git2::Oid) -> CliResult<atomic_core::operation::GitObjectId> {

Callers

nothing calls this directly

Calls 3

git_errorFunction · 0.70
algorithmMethod · 0.45
as_bytesMethod · 0.45

Tested by

no test coverage detected