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

Function restore_preview

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

`atomic restore --dry-run` (the listing form) over PreviewRestore — the would-restore / would-untrack split rides the response.

(paths: Vec<String>)

Source from the content-addressed store, hash-verified

4819/// `atomic restore --dry-run` (the listing form) over PreviewRestore —
4820/// the would-restore / would-untrack split rides the response.
4821pub fn restore_preview(paths: Vec<String>) -> CliResult<bool> {
4822 let Some(session) = Service::open()? else {
4823 return Ok(false);
4824 };
4825 let partial = !paths.is_empty();
4826 let request = pb::PreviewRestoreRequest {
4827 repository: Some(session.reference.clone()),
4828 paths,
4829 force: false,
4830 content_path: None,
4831 };
4832 let response = session.preview_restore(request)?;
4833 render_restore_preview(&response, partial);
4834 Ok(true)
4835}
4836
4837/// `atomic restore --dry-run <file>` (the single-file form) over
4838/// PreviewRestore's content arm — the handler reads the file's pristine

Callers 1

runMethod · 0.85

Calls 5

render_restore_previewFunction · 0.85
openFunction · 0.50
is_emptyMethod · 0.45
cloneMethod · 0.45
preview_restoreMethod · 0.45

Tested by

no test coverage detected