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

Function stash_push

atomic-cli/src/commands/rpc.rs:3754–3775  ·  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

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

Callers 1

runMethod · 0.85

Calls 6

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

Tested by

no test coverage detected