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

Function readonly_snapshot

libatomic/src/review/incremental.rs:1173–1179  ·  view source on GitHub ↗

Windows enforces redb's byte-range locks on ordinary file reads too. Snapshot only while closed, then exercise the real read-only open path.

(repo: Repository)

Source from the content-addressed store, hash-verified

1171 // Windows enforces redb's byte-range locks on ordinary file reads too.
1172 // Snapshot only while closed, then exercise the real read-only open path.
1173 fn readonly_snapshot(repo: Repository) -> (Repository, Vec<u8>) {
1174 let root = repo.root().to_path_buf();
1175 let database = repo.dot_dir().join("atomic.redb");
1176 drop(repo);
1177 let before = std::fs::read(database).unwrap();
1178 (Repository::open_readonly(root).unwrap(), before)
1179 }
1180
1181 fn assert_database_unchanged(repo: Repository, before: Vec<u8>) {
1182 let database = repo.dot_dir().join("atomic.redb");

Calls 4

readFunction · 0.50
rootMethod · 0.45
dot_dirMethod · 0.45
unwrapMethod · 0.45