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,
)
| 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. |
no test coverage detected