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

Function restore_preview

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

4779/// `atomic restore --dry-run` (the listing form) over PreviewRestore —
4780/// the would-restore / would-untrack split rides the response.
4781pub fn restore_preview(paths: Vec<String>) -> CliResult<bool> {
4782 let Some(session) = Service::open()? else {
4783 return Ok(false);
4784 };
4785 let partial = !paths.is_empty();
4786 let request = pb::PreviewRestoreRequest {
4787 repository: Some(session.reference.clone()),
4788 paths,
4789 force: false,
4790 content_path: None,
4791 };
4792 let response = session.preview_restore(request)?;
4793 render_restore_preview(&response, partial);
4794 Ok(true)
4795}
4796
4797/// `atomic restore --dry-run <file>` (the single-file form) over
4798/// PreviewRestore's content arm — the handler reads the file's pristine

Callers 1

runMethod · 0.85

Calls 5

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

Tested by

no test coverage detected