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

Method apply_stash

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

Apply a stash to the current working copy: the sidecar bytes are copied back to disk (a pure filesystem operation — no graph interaction; the domain owns the MANIFEST walk).

(&self, repo: &mut Repository, stash: &StashEntry)

Source from the content-addressed store, hash-verified

338 /// copied back to disk (a pure filesystem operation — no graph
339 /// interaction; the domain owns the MANIFEST walk).
340 fn apply_stash(&self, repo: &mut Repository, stash: &StashEntry) -> CliResult<()> {
341 let (_entry, applied) = repo
342 .stash_apply(Some(&stash.view_name))
343 .map_err(|message| CliError::Internal(anyhow::anyhow!(message)))?;
344
345 if !applied.is_empty() {
346 print_success(&format!("Applied {} to working copy", stash.reference()));
347 } else {
348 print_warning("Stash was already applied or is empty");
349 }
350 Ok(())
351 }
352
353 /// Execute stash list.
354 fn run_list(&self, repo: &Repository) -> CliResult<()> {

Callers 3

run_popMethod · 0.45
run_applyMethod · 0.45
stash_applyFunction · 0.45

Calls 4

print_successFunction · 0.85
print_warningFunction · 0.85
stash_applyMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected