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

Function mapped_ref_tip

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

The live tip of `view`'s mapped local ref (hex), or `None`. CB-10A review R6: the ref NAME comes from the PERSISTED published mapping row when one exists (an explicit publish/rename reconciled it), not from a recomputed scope policy that can disagree with the durable row.

(git: &GitRepository, repo: &Repository, view: &str)

Source from the content-addressed store, hash-verified

71/// not from a recomputed scope policy that can disagree with the durable
72/// row.
73pub(crate) fn mapped_ref_tip(git: &GitRepository, repo: &Repository, view: &str) -> Option<String> {
74 let persisted = repo
75 .get_ref_mapping(view)
76 .ok()
77 .flatten()
78 .and_then(|mapping| mapping.local_ref.clone());
79 let local_ref = match persisted {
80 Some(local_ref) => local_ref,
81 None => mapped_ref_for_view(repo, view).ok()??,
82 };
83 observed_tip(git, Some(&local_ref))
84}
85
86/// Load the persisted mapping for `view`, creating the Synchronized baseline
87/// from the live observation when absent (journaled, CB-10A task 1).

Callers 3

sync_git_head_to_viewFunction · 0.85
ref_mapping_census_classFunction · 0.85

Calls 5

mapped_ref_for_viewFunction · 0.85
observed_tipFunction · 0.85
get_ref_mappingMethod · 0.80
okMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected