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

Function run_enable_anchor

atomic-cli/src/commands/git/anchor.rs:58–87  ·  view source on GitHub ↗

Run the CB-7A anchoring phase for `shim enable`.

(root: &Path, options: &EnableAnchorOptions)

Source from the content-addressed store, hash-verified

56
57/// Run the CB-7A anchoring phase for `shim enable`.
58pub(crate) fn run_enable_anchor(root: &Path, options: &EnableAnchorOptions) -> CliResult<()> {
59 if options.adopt_git {
60 return Err(adopt_git_refusal());
61 }
62 match enable_anchor_inner(root, options) {
63 Ok(EnableAnchorOutcome::Anchored {
64 binding_id,
65 view,
66 git_head,
67 replayed,
68 }) => {
69 if replayed {
70 print_success(&format!(
71 "Anchor binding {binding_id} already exists; repeat enable changed nothing (view '{view}', Git HEAD {git_head})"
72 ));
73 } else {
74 print_success(&format!(
75 "Anchor binding {binding_id} created for view '{view}' at Git HEAD {git_head}; verified working-copy checkpoint written"
76 ));
77 }
78 print_info("Unbound Git adoption and --adopt-git remain unavailable until Phase 9 foreign synthesis (CB-9B/9C).");
79 Ok(())
80 }
81 Ok(EnableAnchorOutcome::NotAnchored { refusal }) => {
82 print_warning(&format!("shim anchor not created: {refusal}"));
83 Ok(())
84 }
85 Err(error) => Err(error),
86 }
87}
88
89fn enable_anchor_inner(
90 root: &Path,

Callers 1

runMethod · 0.85

Calls 5

adopt_git_refusalFunction · 0.85
enable_anchor_innerFunction · 0.85
print_successFunction · 0.85
print_infoFunction · 0.85
print_warningFunction · 0.85

Tested by

no test coverage detected