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

Function mapped_ref_for_view

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

The mapped local ref for `view` under the §8.1 scope policy. Shared → `refs/heads/ ` (symbolic HEAD), Draft → `refs/atomic/views/ ` (detached HEAD), ephemeral `git/ ` → `None` (no extra ref beyond the original commit).

(repo: &Repository, view: &str)

Source from the content-addressed store, hash-verified

29/// `refs/atomic/views/<name>` (detached HEAD), ephemeral `git/<oid>` →
30/// `None` (no extra ref beyond the original commit).
31pub(crate) fn mapped_ref_for_view(repo: &Repository, view: &str) -> CliResult<Option<String>> {
32 if is_ephemeral_view_name(view) {
33 return Ok(None);
34 }
35 let scope = repo.get_view_info(view).map_err(CliError::from)?.scope;
36 Ok(mapped_local_ref(scope, view))
37}
38
39/// The durable internal view id for `view` (mapping key identity).
40fn durable_view_id(repo: &Repository, view: &str) -> CliResult<u64> {

Callers 1

mapped_ref_tipFunction · 0.85

Calls 3

is_ephemeral_view_nameFunction · 0.85
mapped_local_refFunction · 0.85
get_view_infoMethod · 0.80

Tested by

no test coverage detected