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

Function current_snapshot

libatomic/src/daemon/services_sandbox.rs:171–179  ·  view source on GitHub ↗

`view`'s snapshot as the repository has it now.

(repo: &Repository, view: &str)

Source from the content-addressed store, hash-verified

169
170/// `view`'s snapshot as the repository has it now.
171fn current_snapshot(repo: &Repository, view: &str) -> Result<ViewSnapshot, Status> {
172 let effective = repo.sandbox_effective_state(view).map_err(view_error)?;
173 let own = repo
174 .export_sandbox_skeleton(view, &BTreeMap::new())
175 .map_err(view_error)?
176 .view
177 .state;
178 Ok(wire::view_snapshot(view, &effective, Some(&own)))
179}
180
181/// Refuse unless `expected` is the view's snapshot now.
182fn fence(repo: &Repository, view: &str, expected: &ViewSnapshot) -> Result<ViewSnapshot, Status> {

Callers 4

fenceFunction · 0.85
open_sandboxMethod · 0.85
get_file_statesMethod · 0.85
submit_changeMethod · 0.85

Calls 3

view_snapshotFunction · 0.85

Tested by

no test coverage detected