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

Function expected_git_oid

atomic-repository/src/repository/equivalence.rs:707–720  ·  view source on GitHub ↗
(
    entry: &RepositoryEntry,
    algorithm: GitHashAlgorithm,
)

Source from the content-addressed store, hash-verified

705}
706
707fn expected_git_oid(
708 entry: &RepositoryEntry,
709 algorithm: GitHashAlgorithm,
710) -> Result<GitObjectId, ProjectTreeError> {
711 match entry.kind {
712 InodeKind::Gitlink => entry
713 .gitlink
714 .clone()
715 .ok_or_else(|| ProjectTreeError::InvalidGitlink("missing Git object identity".into())),
716 InodeKind::Regular | InodeKind::Symlink => {
717 git_object_id(algorithm, GitObjectKind::Blob, &entry.repository_bytes)
718 }
719 }
720}
721
722fn kind_from_git_mode(mode: u32) -> Option<InodeKind> {
723 match mode {

Callers 1

compare_index_intoFunction · 0.85

Calls 2

git_object_idFunction · 0.70
cloneMethod · 0.45

Tested by

no test coverage detected