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

Method verify_bound_binding

atomic-repository/src/repository/resurrection.rs:740–757  ·  view source on GitHub ↗

Cryptography + Git structural verification of one binding, restoring a lost commit from the binding's preserved raw bytes first.

(
        &self,
        git: &git2::Repository,
        binding: &GitStateBinding,
    )

Source from the content-addressed store, hash-verified

738 /// Cryptography + Git structural verification of one binding, restoring
739 /// a lost commit from the binding's preserved raw bytes first.
740 fn verify_bound_binding(
741 &self,
742 git: &git2::Repository,
743 binding: &GitStateBinding,
744 ) -> Result<bool, RepositoryError> {
745 verify_binding_cryptography(binding).map_err(|error| RepositoryError::BindingRejected {
746 id: binding.id().to_hex(),
747 commit: binding.payload().git_commit.to_hex(),
748 reason: format!("cryptography: {error}"),
749 })?;
750 let restored = self.ensure_bound_commit_readable(git, binding)?;
751 verify_binding_content(git, binding).map_err(|error| RepositoryError::BindingRejected {
752 id: binding.id().to_hex(),
753 commit: binding.payload().git_commit.to_hex(),
754 reason: format!("git content: {error}"),
755 })?;
756 Ok(restored)
757 }
758
759 /// Ensure the bound commit is readable from the Git ODB, restoring the
760 /// preserved raw bytes when it is absent.

Callers 2

Calls 6

verify_binding_contentFunction · 0.85
to_hexMethod · 0.45
idMethod · 0.45
payloadMethod · 0.45

Tested by

no test coverage detected