`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)
| 3752 | /// should fall back (unreachable daemon). An empty stash_id in the |
| 3753 | /// response means a clean working copy. |
| 3754 | pub 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. |
| 3778 | pub fn stash_apply(stash: Option<String>) -> CliResult<bool> { |
no test coverage detected