Get the path where a change file should be stored. Changes are stored in a two-level directory structure based on their hash: `.atomic/changes/AB/CDEF...` where AB is the first two characters of the base32-encoded hash.
(&self, hash_base32: &str)
| 627 | /// `.atomic/changes/AB/CDEF...` where AB is the first two characters of the |
| 628 | /// base32-encoded hash. |
| 629 | pub fn change_path(&self, hash_base32: &str) -> PathBuf { |
| 630 | let prefix = &hash_base32[..2.min(hash_base32.len())]; |
| 631 | self.changes_dir().join(prefix).join(hash_base32) |
| 632 | } |
| 633 | |
| 634 | /// Convert an absolute path to a repository-relative path. |
| 635 | pub fn to_relative<P: AsRef<Path>>(&self, path: P) -> Option<PathBuf> { |