MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / change_path

Method change_path

atomic-repository/src/repository/mod.rs:712–715  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

710 /// `.atomic/changes/AB/CDEF...` where AB is the first two characters of the
711 /// base32-encoded hash.
712 pub fn change_path(&self, hash_base32: &str) -> PathBuf {
713 let prefix = &hash_base32[..2.min(hash_base32.len())];
714 self.changes_dir().join(prefix).join(hash_base32)
715 }
716
717 /// Convert an absolute path to a repository-relative path.
718 pub fn to_relative<P: AsRef<Path>>(&self, path: P) -> Option<PathBuf> {

Callers 4

load_change_dataFunction · 0.45
upload_change_smartFunction · 0.45
save_change_bytesMethod · 0.45
test_change_pathFunction · 0.45

Calls 2

lenMethod · 0.45
changes_dirMethod · 0.45

Tested by 1

test_change_pathFunction · 0.36