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

Method run_drop

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

Execute stash drop.

(&self, repo: &mut Repository, stash_ref: Option<&str>)

Source from the content-addressed store, hash-verified

661
662 /// Execute stash drop.
663 fn run_drop(&self, repo: &mut Repository, stash_ref: Option<&str>) -> CliResult<()> {
664 let stash = self.parse_stash_ref(repo, stash_ref)?;
665
666 // Delete the sidecar directory
667 let stash_dir = repo.dot_dir().join("stashes").join(&stash.view_name);
668 if stash_dir.exists() {
669 let _ = std::fs::remove_dir_all(&stash_dir);
670 }
671
672 // Delete the stash view
673 repo.delete_view(&stash.view_name)
674 .map_err(CliError::Repository)?;
675
676 print_success(&format!("Dropped {}", stash.reference()));
677 Ok(())
678 }
679
680 /// Execute stash clear.
681 fn run_clear(&self, repo: &mut Repository, force: bool) -> CliResult<()> {

Callers 1

runMethod · 0.80

Calls 5

print_successFunction · 0.85
parse_stash_refMethod · 0.80
dot_dirMethod · 0.80
delete_viewMethod · 0.80
existsMethod · 0.45

Tested by

no test coverage detected