Compute the filesystem path for a change with the given hash. The path follows the two-level directory structure: `{changes_dir}/{prefix}/{full_hash}.change` # Arguments `hash` - The hash of the change # Example ```rust,ignore let hash = Hash::of(b"test"); let path = store.change_path(&hash); // e.g., ".atomic/changes/AB/ABCDEF1234567890....change" ```
(&self, hash: &Hash)
| 285 | /// // e.g., ".atomic/changes/AB/ABCDEF1234567890....change" |
| 286 | /// ``` |
| 287 | pub fn change_path(&self, hash: &Hash) -> PathBuf { |
| 288 | let hash_str = hash.to_base32(); |
| 289 | let (prefix, _) = hash_str.split_at(HASH_PREFIX_LEN.min(hash_str.len())); |
| 290 | self.changes_dir |
| 291 | .join(prefix) |
| 292 | .join(format!("{}.{}", hash_str, CHANGE_EXTENSION)) |
| 293 | } |
| 294 | |
| 295 | /// Check if a change with the given hash exists on disk. |
| 296 | /// |