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

Function unpersisted_mapping

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

Build the display-only mapping for a workspace view without a persisted row (read-only; `view_id` 0 marks it unpersisted).

(repo: &Repository, view: &str)

Source from the content-addressed store, hash-verified

562/// Build the display-only mapping for a workspace view without a persisted
563/// row (read-only; `view_id` 0 marks it unpersisted).
564fn unpersisted_mapping(repo: &Repository, view: &str) -> CliResult<RefMapping> {
565 let info = repo.get_view_info(view).map_err(CliError::from)?;
566 Ok(RefMapping {
567 version: REF_MAPPING_VERSION,
568 view_id: 0,
569 view_name: view.to_string(),
570 scope: info.scope as u8,
571 local_ref: if is_ephemeral_view_name(view) {
572 None
573 } else {
574 mapped_local_ref(info.scope, view)
575 },
576 remote: None,
577 last_observed_local: None,
578 last_observed_remote: None,
579 last_exported: None,
580 last_exported_state: None,
581 last_observed_atomic: None,
582 status: RefSyncStatus::Synchronized,
583 })
584}
585
586/// `atomic git shim publish <view> --branch <name>`: explicit Draft
587/// publication (RFC §8.1, CB-10A AC-2).

Callers 1

run_statusFunction · 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