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)
| 235 | /// // e.g., ".atomic/changes/AB/ABCDEF1234567890....change" |
| 236 | /// ``` |
| 237 | pub fn change_path(&self, hash: &Hash) -> PathBuf { |
| 238 | let hash_str = hash.to_base32(); |
| 239 | let (prefix, _) = hash_str.split_at(HASH_PREFIX_LEN.min(hash_str.len())); |
| 240 | self.changes_dir |
| 241 | .join(prefix) |
| 242 | .join(format!("{}.{}", hash_str, CHANGE_EXTENSION)) |
| 243 | } |
| 244 | |
| 245 | /// Check if a change with the given hash exists on disk. |
| 246 | /// |