(&self)
| 190 | |
| 191 | impl crate::commands::Command for Insert { |
| 192 | fn run(&self) -> CliResult<()> { |
| 193 | let repo_path = self.repository.as_ref().map(std::path::Path::new); |
| 194 | let repo = require_repository(repo_path)?; |
| 195 | |
| 196 | match &self.command { |
| 197 | Some(InsertSubcommand::View(args)) => run_view_insert(&repo, args), |
| 198 | Some(InsertSubcommand::Tag(args)) => run_tag(&repo, args), |
| 199 | Some(InsertSubcommand::Change(args)) => run_change_insert(&repo, args), |
| 200 | Some(InsertSubcommand::Preview(args)) => run_preview(&repo, args), |
| 201 | None => { |
| 202 | if let Some(ref change_str) = self.change { |
| 203 | // Insert a single change into the current (or --view) view. |
| 204 | run_single_insert(&repo, change_str, self) |
| 205 | } else { |
| 206 | // No change and no subcommand: promote the current view's |
| 207 | // changes into its parent view. |
| 208 | run_promote_to_parent(&repo, self) |
| 209 | } |
| 210 | } |
| 211 | } |
| 212 | } |
| 213 | } |
| 214 | |
| 215 | // Subcommand Implementations |
nothing calls this directly
no test coverage detected