The shared render for the restore previews — the local listing branch's exact lines over the wire-carried classification.
(response: &pb::PreviewMutationResponse, partial: bool)
| 4789 | /// The shared render for the restore previews — the local listing |
| 4790 | /// branch's exact lines over the wire-carried classification. |
| 4791 | fn render_restore_preview(response: &pb::PreviewMutationResponse, partial: bool) { |
| 4792 | if response.affected_paths.is_empty() && response.untracked.is_empty() { |
| 4793 | // The local body's partial/whole split: naming paths must not |
| 4794 | // claim the whole working copy is clean. |
| 4795 | println!( |
| 4796 | "{}", |
| 4797 | if partial { |
| 4798 | "Nothing to restore for the specified path(s)" |
| 4799 | } else { |
| 4800 | "Nothing to restore - working copy is clean" |
| 4801 | } |
| 4802 | ); |
| 4803 | return; |
| 4804 | } |
| 4805 | for path in &response.affected_paths { |
| 4806 | println!("Would restore: {path}"); |
| 4807 | } |
| 4808 | for path in &response.untracked { |
| 4809 | println!("Would untrack: {path} (kept on disk)"); |
| 4810 | } |
| 4811 | println!(); |
| 4812 | let total = response.affected_paths.len() + response.untracked.len(); |
| 4813 | print_hint(&format!( |
| 4814 | "(dry run - {} would be restored)", |
| 4815 | super::restore::format_count(total, "file") |
| 4816 | )); |
| 4817 | } |
| 4818 | |
| 4819 | /// `atomic restore --dry-run` (the listing form) over PreviewRestore — |
| 4820 | /// the would-restore / would-untrack split rides the response. |
no test coverage detected