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