(
repo: &Repository,
git_repo: &GitRepository,
view: &str,
ref_name: &str,
intended_ref: Option<atomic_core::operation::GitRefTarget>,
intended_head: Option<atomic_core::operat
| 1851 | /// re-observed state. |
| 1852 | #[allow(clippy::too_many_arguments)] |
| 1853 | fn journal_projection_publication( |
| 1854 | repo: &Repository, |
| 1855 | git_repo: &GitRepository, |
| 1856 | view: &str, |
| 1857 | ref_name: &str, |
| 1858 | intended_ref: Option<atomic_core::operation::GitRefTarget>, |
| 1859 | intended_head: Option<atomic_core::operation::GitRefTarget>, |
| 1860 | objects: Vec<( |
| 1861 | atomic_core::operation::GitObjectId, |
| 1862 | git2::ObjectType, |
| 1863 | Vec<u8>, |
| 1864 | )>, |
| 1865 | intended_index_tree: Option<git2::Oid>, |
| 1866 | checkpoint_plan: Option<atomic_repository::ProjectionCheckpointPlan>, |
| 1867 | held_common: Option<&atomic_repository::RepositoryCommonLockGuard>, |
| 1868 | ) -> CliResult<Option<atomic_core::OperationId>> { |
| 1869 | let working_copy = repo |
| 1870 | .require_working_copy_id() |
| 1871 | .map_err(CliError::Repository)?; |
| 1872 | let evidence = |
| 1873 | atomic_core::Hash::of(format!("atomic:projection-publish:{view}:{ref_name}").as_bytes()); |
| 1874 | let prepared = repo |
| 1875 | .prepare_projection_publication( |
| 1876 | working_copy, |
| 1877 | held_common, |
| 1878 | git_repo, |
| 1879 | ref_name, |
| 1880 | intended_ref, |
| 1881 | intended_head, |
| 1882 | objects, |
| 1883 | intended_index_tree, |
| 1884 | checkpoint_plan, |
| 1885 | evidence, |
| 1886 | ) |
| 1887 | .map_err(CliError::Repository)?; |
| 1888 | if prepared.operation_id == atomic_core::OperationId::from_bytes([0u8; 32]) { |
| 1889 | // Every lease already held the intended value: an idempotent no-op. |
| 1890 | return Ok(None); |
| 1891 | } |
| 1892 | let operation_id = prepared.operation_id; |
| 1893 | repo.execute_projection_publish(&prepared, git_repo) |
| 1894 | .map_err(CliError::Repository)?; |
| 1895 | repo.finalize_projection_publish(prepared, git_repo) |
| 1896 | .map_err(CliError::Repository)?; |
| 1897 | Ok(Some(operation_id)) |
| 1898 | } |
| 1899 | |
| 1900 | /// §5.5 identity resolution for projected commits: Atomic identity first, |
| 1901 | /// then the configured `[git.identity]` mapping, then a deterministic |
no test coverage detected