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)
| 850 | /// `.atomic/changes/AB/CDEF...` where AB is the first two characters of the |
| 851 | /// base32-encoded hash. |
| 852 | pub fn change_path(&self, hash_base32: &str) -> PathBuf { |
| 853 | let prefix = &hash_base32[..2.min(hash_base32.len())]; |
| 854 | self.changes_dir().join(prefix).join(hash_base32) |
| 855 | } |
| 856 | |
| 857 | /// Convert an absolute path to a repository-relative path. |
| 858 | pub fn to_relative<P: AsRef<Path>>(&self, path: P) -> Option<PathBuf> { |