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

Function repository_path

atomic-cli/src/commands/git/parallel.rs:9590–9601  ·  view source on GitHub ↗

The repository's spelling of a canonical (escaped) Git path: the raw bytes when they are UTF-8, exactly as native tracking records a path, so TREE, FILE_INDEX and the change's own file ops carry the name `atomic status` and `atomic restore ` see on disk. Registering the escaped identity instead left every path with a space or a non-ASCII byte tracked as `has%20space.txt`: dirty status right

(path: &str)

Source from the content-addressed store, hash-verified

9588/// tree names, so a raw `%` would be read as an escape (a pre-existing
9589/// limit shared with native tracking).
9590pub(super) fn repository_path(path: &str) -> std::borrow::Cow<'_, str> {
9591 if !path.contains('%') {
9592 return std::borrow::Cow::Borrowed(path);
9593 }
9594 match atomic_repository::unescape_repo_path(path)
9595 .ok()
9596 .and_then(|bytes| String::from_utf8(bytes).ok())
9597 {
9598 Some(raw) if !raw.contains('%') => std::borrow::Cow::Owned(raw),
9599 _ => std::borrow::Cow::Borrowed(path),
9600 }
9601}
9602
9603/// A physical filesystem path decoded from the canonical String identity.
9604pub(super) fn canonical_tree_path(path: &str) -> PathBuf {

Calls 3

unescape_repo_pathFunction · 0.85
containsMethod · 0.45
okMethod · 0.45