(
repo: &Repository,
git_repo: &GitRepository,
view: &str,
ref_name: &str,
intended_ref: Option<atomic_core::operation::GitRefTarget>,
intended_head: Option<atomic_core::operat
| 1663 | /// re-observed state. |
| 1664 | #[allow(clippy::too_many_arguments)] |
| 1665 | fn journal_projection_publication( |
| 1666 | repo: &Repository, |
| 1667 | git_repo: &GitRepository, |
| 1668 | view: &str, |
| 1669 | ref_name: &str, |
| 1670 | intended_ref: Option<atomic_core::operation::GitRefTarget>, |
| 1671 | intended_head: Option<atomic_core::operation::GitRefTarget>, |
| 1672 | objects: Vec<( |
| 1673 | atomic_core::operation::GitObjectId, |
| 1674 | git2::ObjectType, |
| 1675 | Vec<u8>, |
| 1676 | )>, |
| 1677 | intended_index_tree: Option<git2::Oid>, |
| 1678 | checkpoint_plan: Option<atomic_repository::ProjectionCheckpointPlan>, |
| 1679 | held_common: Option<&atomic_repository::RepositoryCommonLockGuard>, |
| 1680 | ) -> CliResult<Option<atomic_core::OperationId>> { |
| 1681 | let working_copy = repo |
| 1682 | .require_working_copy_id() |
| 1683 | .map_err(CliError::Repository)?; |
| 1684 | let evidence = |
| 1685 | atomic_core::Hash::of(format!("atomic:projection-publish:{view}:{ref_name}").as_bytes()); |
| 1686 | let prepared = repo |
| 1687 | .prepare_projection_publication( |
| 1688 | working_copy, |
| 1689 | held_common, |
| 1690 | git_repo, |
| 1691 | ref_name, |
| 1692 | intended_ref, |
| 1693 | intended_head, |
| 1694 | objects, |
| 1695 | intended_index_tree, |
| 1696 | checkpoint_plan, |
| 1697 | evidence, |
| 1698 | ) |
| 1699 | .map_err(CliError::Repository)?; |
| 1700 | if prepared.operation_id == atomic_core::OperationId::from_bytes([0u8; 32]) { |
| 1701 | // Every lease already held the intended value: an idempotent no-op. |
| 1702 | return Ok(None); |
| 1703 | } |
| 1704 | let operation_id = prepared.operation_id; |
| 1705 | repo.execute_projection_publish(&prepared, git_repo) |
| 1706 | .map_err(CliError::Repository)?; |
| 1707 | repo.finalize_projection_publish(prepared, git_repo) |
| 1708 | .map_err(CliError::Repository)?; |
| 1709 | Ok(Some(operation_id)) |
| 1710 | } |
| 1711 | |
| 1712 | /// §5.5 identity resolution for projected commits: Atomic identity first, |
| 1713 | /// then the configured `[git.identity]` mapping, then a deterministic |
no test coverage detected