(&self)
| 103 | |
| 104 | impl 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 | |
| 142 | impl Split { |
nothing calls this directly
no test coverage detected