Check if a change with the given hash exists on disk. This checks both the cache and the filesystem. Note that this doesn't verify the integrity of the change file. # Arguments `hash` - The hash of the change to check # Example ```rust,ignore if store.has_change(&hash) { let change = store.load_change(&hash)?; } ```
(&self, hash: &Hash)
| 259 | /// } |
| 260 | /// ``` |
| 261 | pub fn has_change(&self, hash: &Hash) -> bool { |
| 262 | // Check cache first |
| 263 | if self |
| 264 | .cache |
| 265 | .read() |
| 266 | .map(|c| c.contains_key(hash)) |
| 267 | .unwrap_or(false) |
| 268 | { |
| 269 | return true; |
| 270 | } |
| 271 | |
| 272 | // Check filesystem |
| 273 | self.change_path(hash).exists() |
| 274 | } |
| 275 | |
| 276 | /// Save a change to disk. |
| 277 | /// |
nothing calls this directly
no test coverage detected