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)
| 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"); |