Make renames in `dir` durable. Directory fsync is only portable on Unix; elsewhere the renames are still atomic.
(dir: &Path)
| 240 | /// Make renames in `dir` durable. Directory fsync is only portable on Unix; |
| 241 | /// elsewhere the renames are still atomic. |
| 242 | fn sync_dir(dir: &Path) -> Result<(), RepositoryError> { |
| 243 | #[cfg(unix)] |
| 244 | std::fs::File::open(dir)?.sync_all()?; |
| 245 | #[cfg(not(unix))] |
| 246 | let _ = dir; |
| 247 | Ok(()) |
| 248 | } |
| 249 | |
| 250 | fn is_already_open(error: &PristineError) -> bool { |
| 251 | matches!(error, PristineError::Database(inner) |
no test coverage detected