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

Method run

atomic-cli/src/commands/insert.rs:168–188  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

166
167impl crate::commands::Command for Insert {
168 fn run(&self) -> CliResult<()> {
169 let repo_path = self.repository.as_ref().map(std::path::Path::new);
170 let repo = require_repository(repo_path)?;
171
172 match &self.command {
173 Some(InsertSubcommand::FromView(args)) => run_from_view(&repo, args),
174 Some(InsertSubcommand::Tag(args)) => run_tag(&repo, args),
175 Some(InsertSubcommand::Pick(args)) => run_pick(&repo, args),
176 Some(InsertSubcommand::Preview(args)) => run_preview(&repo, args),
177 None => {
178 // Insert a single change
179 if let Some(ref change_str) = self.change {
180 run_single_insert(&repo, change_str, self)
181 } else {
182 Err(CliError::InvalidArgument {
183 message: "Missing CHANGE argument. Provide a change hash or use a subcommand (from-view, tag, pick)".to_string(),
184 })
185 }
186 }
187 }
188 }
189}
190
191// Subcommand Implementations

Callers

nothing calls this directly

Calls 7

require_repositoryFunction · 0.85
run_from_viewFunction · 0.85
run_tagFunction · 0.85
run_pickFunction · 0.85
run_previewFunction · 0.85
run_single_insertFunction · 0.85
as_refMethod · 0.80

Tested by

no test coverage detected