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

Method run

atomic-cli/src/commands/view/split.rs:105–139  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

103
104impl Command for Split {
105 fn run(&self) -> CliResult<()> {
106 // The service executes a dispatched split directly, so a real,
107 // unacknowledged split is previewed and confirmed client-side
108 // BEFORE any dispatch. The analysis is best-effort: a refusal to
109 // proceed (cancel / no terminal) is final, but any other analysis
110 // failure is deferred so the dispatch or local execution below
111 // surfaces the canonical error. Dry-run previews stay local.
112 let pre_confirmed = !self.dry_run && !self.confirm;
113 if pre_confirmed {
114 let gate = match find_repository_root() {
115 Ok(repo_root) => match Repository::open(&repo_root) {
116 Ok(mut repo) => self.confirm_gate(&mut repo, confirm_in_terminal),
117 Err(_) => Ok(()),
118 },
119 Err(e) => Err(e),
120 };
121 if let Err(e @ (CliError::Cancelled | CliError::InvalidArgument { .. })) = gate {
122 return Err(e);
123 }
124 }
125
126 if !self.dry_run && crate::commands::rpc::view_split(self)? {
127 return Ok(());
128 }
129
130 let repo_root = find_repository_root()?;
131 let mut repo = Repository::open(&repo_root).map_err(|e| match e {
132 atomic_repository::RepositoryError::NotFound { path } => CliError::RepositoryNotFound {
133 searched_path: path.into(),
134 },
135 other => CliError::Repository(other),
136 })?;
137
138 self.execute_with_repo_gated(&mut repo, pre_confirmed, confirm_in_terminal)
139 }
140}
141
142impl Split {

Callers

nothing calls this directly

Calls 6

find_repository_rootFunction · 0.85
openFunction · 0.85
view_splitFunction · 0.85
RepositoryClass · 0.85
confirm_gateMethod · 0.80

Tested by

no test coverage detected