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

Function stash_apply

atomic-cli/src/commands/rpc.rs:3779–3798  ·  view source on GitHub ↗

`atomic stash apply` over ApplyStash. Renders the applied-file count.

(stash: Option<String>)

Source from the content-addressed store, hash-verified

3777
3778/// `atomic stash apply` over ApplyStash. Renders the applied-file count.
3779pub fn stash_apply(stash: Option<String>) -> CliResult<bool> {
3780 let Some(session) = Service::open()? else {
3781 return Ok(false);
3782 };
3783 let request = pb::ApplyStashRequest {
3784 repository: Some(session.reference.clone()),
3785 meta: None,
3786 stash_id: stash.clone().unwrap_or_default(),
3787 };
3788 let response = session.apply_stash(request)?;
3789 if response.applied.is_empty() {
3790 print_warning("Stash was already applied or is empty");
3791 } else {
3792 print_success(&format!(
3793 "Applied {} file(s) to working copy",
3794 response.applied.len()
3795 ));
3796 }
3797 Ok(true)
3798}
3799
3800/// `atomic stash pop` composes ApplyStash then DropStash (the wire's
3801/// reserved field 4 documents exactly this client-side composition).

Callers 2

runMethod · 0.85
stash_popFunction · 0.85

Calls 6

print_warningFunction · 0.85
print_successFunction · 0.85
openFunction · 0.50
cloneMethod · 0.45
apply_stashMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected