MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / restore

Method restore

crates/opencode-session/src/snapshot.rs:69–74  ·  view source on GitHub ↗
(directory: &Path, snapshot: &str)

Source from the content-addressed store, hash-verified

67 }
68
69 pub fn restore(directory: &Path, snapshot: &str) -> Result<()> {
70 let git_dir = ensure_snapshot_repo(directory)?;
71 git_output(directory, &git_dir, &["read-tree", snapshot])?;
72 git_output(directory, &git_dir, &["checkout-index", "-a", "-f"])?;
73 Ok(())
74 }
75
76 pub fn diff(directory: &Path, from_hash: &str) -> Result<Vec<super::FileDiff>> {
77 let git_dir = ensure_snapshot_repo(directory)?;

Callers

nothing calls this directly

Calls 2

ensure_snapshot_repoFunction · 0.85
git_outputFunction · 0.70

Tested by

no test coverage detected