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

Method run

atomic-cli/src/commands/stash.rs:725–749  ·  view source on GitHub ↗

Execute the stash command.

(&self)

Source from the content-addressed store, hash-verified

723impl Command for Stash {
724 /// Execute the stash command.
725 fn run(&self) -> CliResult<()> {
726 // Find repository
727 let repo_root = find_repository_root()?;
728 let mut repo = Repository::open(&repo_root).map_err(CliError::Repository)?;
729
730 match &self.command {
731 None => {
732 // Default action: push
733 self.run_push(&mut repo, None, self.include_untracked, self.keep)
734 }
735 Some(StashSubcommand::Push {
736 message,
737 include_untracked,
738 keep,
739 }) => self.run_push(&mut repo, message.clone(), *include_untracked, *keep),
740 Some(StashSubcommand::Pop { stash }) => self.run_pop(&mut repo, stash.as_deref()),
741 Some(StashSubcommand::Apply { stash }) => self.run_apply(&mut repo, stash.as_deref()),
742 Some(StashSubcommand::List) => self.run_list(&repo),
743 Some(StashSubcommand::Show { stash, patch }) => {
744 self.run_show(&repo, stash.as_deref(), *patch)
745 }
746 Some(StashSubcommand::Drop { stash }) => self.run_drop(&mut repo, stash.as_deref()),
747 Some(StashSubcommand::Clear { force }) => self.run_clear(&mut repo, *force),
748 }
749 }
750}
751
752// Tests

Callers

nothing calls this directly

Calls 9

find_repository_rootFunction · 0.85
run_pushMethod · 0.80
run_popMethod · 0.80
run_applyMethod · 0.80
run_listMethod · 0.80
run_showMethod · 0.80
run_dropMethod · 0.80
run_clearMethod · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected