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

Function stash_push

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

`atomic stash push` over CreateStash. Returns Ok(false) when the call should fall back (unreachable daemon). An empty stash_id in the response means a clean working copy.

(message: Option<String>, include_untracked: bool, keep: bool)

Source from the content-addressed store, hash-verified

3753/// should fall back (unreachable daemon). An empty stash_id in the
3754/// response means a clean working copy.
3755pub fn stash_push(message: Option<String>, include_untracked: bool, keep: bool) -> CliResult<bool> {
3756 let Some(session) = Service::open()? else {
3757 return Ok(false);
3758 };
3759 let request = pb::CreateStashRequest {
3760 repository: Some(session.reference.clone()),
3761 meta: None,
3762 message,
3763 include_untracked,
3764 keep,
3765 };
3766 let response = session.create_stash(request)?;
3767 if response.stash_id.is_empty() {
3768 print_warning("No local changes to save");
3769 return Ok(true);
3770 }
3771 print_success(&format!("Saved working copy to {}", response.stash_id));
3772 if !keep {
3773 print_success("Working copy restored to clean state");
3774 }
3775 Ok(true)
3776}
3777
3778/// `atomic stash apply` over ApplyStash. Renders the applied-file count.
3779pub fn stash_apply(stash: Option<String>) -> CliResult<bool> {

Callers 1

runMethod · 0.85

Calls 6

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

Tested by

no test coverage detected