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

Function relativize

atomic-cli/src/commands/rpc.rs:607–616  ·  view source on GitHub ↗
(path: &str, root: &Path)

Source from the content-addressed store, hash-verified

605}
606
607fn relativize(path: &str, root: &Path) -> String {
608 let candidate = Path::new(path);
609 if candidate.is_absolute() {
610 if let Ok(relative) = candidate.strip_prefix(root) {
611 return relative.display().to_string();
612 }
613 return path.to_string();
614 }
615 path.to_string()
616}
617
618/// `atomic record` over Record — every form. The message composes
619/// client-side with the SAME editor/prompt flow the local body uses

Callers 2

addFunction · 0.85
recordFunction · 0.85

Calls 1

displayMethod · 0.80

Tested by

no test coverage detected