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

Function persist_diverged_status

atomic-cli/src/commands/git/ref_mapping.rs:397–414  ·  view source on GitHub ↗

Persist the `Diverged` status without moving either side (RFC §8.5).

(
    repo: &Repository,
    working_copy: WorkingCopyId,
    mapping: &RefMapping,
)

Source from the content-addressed store, hash-verified

395
396/// Persist the `Diverged` status without moving either side (RFC §8.5).
397pub(crate) fn persist_diverged_status(
398 repo: &Repository,
399 working_copy: WorkingCopyId,
400 mapping: &RefMapping,
401) -> CliResult<()> {
402 let mut diverged = mapping.clone();
403 diverged.status = RefSyncStatus::Diverged;
404 // Pinned to the classified row: a concurrent mapping move must not be
405 // clobbered by this status write (CB-10A review R6).
406 repo.set_ref_mapping_from_observation(
407 working_copy,
408 &mapping.view_name,
409 Some(mapping),
410 Some(diverged),
411 )
412 .map_err(CliError::from)?;
413 Ok(())
414}
415
416/// The actionable remediation text for a mapping status (AC-2 diagnostics).
417pub(crate) fn remediation_for(status: RefSyncStatus) -> &'static str {

Callers 1

Calls 2

cloneMethod · 0.45

Tested by

no test coverage detected