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

Function mapped_local_ref

atomic-repository/src/repository/ref_mapping.rs:47–54  ·  view source on GitHub ↗

Scope-specific Git representation of a view (RFC §8.1).

(scope: ViewScope, view: &str)

Source from the content-addressed store, hash-verified

45
46/// Scope-specific Git representation of a view (RFC §8.1).
47pub fn mapped_local_ref(scope: ViewScope, view: &str) -> Option<String> {
48 match scope {
49 // Shared views publish on a real branch (symbolic HEAD).
50 ViewScope::Shared => Some(format!("refs/heads/{view}")),
51 // Drafts publish on the private namespace (detached HEAD).
52 ViewScope::Draft => Some(format!("refs/atomic/views/{view}")),
53 }
54}
55
56/// Ephemeral `git/<oid>` views have no extra ref beyond the original commit
57/// (RFC §8.1): their mapping deliberately carries `local_ref: None`.

Callers 6

mapped_ref_for_viewFunction · 0.85
ensure_baseline_mappingFunction · 0.85
unpersisted_mappingFunction · 0.85
install_shim_evidenceFunction · 0.85

Calls

no outgoing calls

Tested by 1

install_shim_evidenceFunction · 0.68