(
&self,
source: Option<&Repository>,
parsed: &ParsedCommit,
encoded_hashes: &[String],
)
| 4581 | } |
| 4582 | |
| 4583 | fn validate_claimed_change_roots( |
| 4584 | &self, |
| 4585 | source: Option<&Repository>, |
| 4586 | parsed: &ParsedCommit, |
| 4587 | encoded_hashes: &[String], |
| 4588 | ) -> CliResult<()> { |
| 4589 | let source = source.ok_or_else(|| { |
| 4590 | git_error(format!( |
| 4591 | "commit {} claims Atomic changes but no Atomic repository exists", |
| 4592 | parsed.git_sha |
| 4593 | )) |
| 4594 | })?; |
| 4595 | for encoded in encoded_hashes { |
| 4596 | let hash = ContentHash::from_base32(encoded.as_bytes()).ok_or_else(|| { |
| 4597 | git_error(format!( |
| 4598 | "commit {} carries invalid Atomic-Changes value '{encoded}'", |
| 4599 | parsed.git_sha |
| 4600 | )) |
| 4601 | })?; |
| 4602 | source.load_change(&hash).map_err(|error| { |
| 4603 | git_error(format!( |
| 4604 | "commit {} references unavailable Atomic change {encoded}: {error}", |
| 4605 | parsed.git_sha |
| 4606 | )) |
| 4607 | })?; |
| 4608 | } |
| 4609 | Ok(()) |
| 4610 | } |
| 4611 | |
| 4612 | fn verify_claimed_change_closure( |
| 4613 | &self, |
no test coverage detected