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

Method change_path

atomic-repository/src/changestore/mod.rs:237–243  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 ///

Callers 10

has_changeMethod · 0.45
save_changeMethod · 0.45
load_changeMethod · 0.45
copy_content_spanMethod · 0.45
delete_changeMethod · 0.45
test_change_path_formatFunction · 0.45
test_save_changeFunction · 0.45
test_delete_changeFunction · 0.45

Calls 2

to_base32Method · 0.45
lenMethod · 0.45

Tested by 5

test_change_path_formatFunction · 0.36
test_save_changeFunction · 0.36
test_delete_changeFunction · 0.36