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

Function short_path

atomic-agent/src/provenance/consolidate.rs:719–727  ·  view source on GitHub ↗

Shorten a file path for summary display.

(path: &str)

Source from the content-addressed store, hash-verified

717
718/// Shorten a file path for summary display.
719fn short_path(path: &str) -> String {
720 // If the path has more than 3 components, show last 2
721 let components: Vec<&str> = path.split('/').collect();
722 if components.len() > 3 {
723 components[components.len() - 2..].join("/")
724 } else {
725 path.to_string()
726 }
727}
728
729/// Truncate a string for display.
730fn truncate(s: &str, max_len: usize) -> String {

Callers

nothing calls this directly

Calls 2

collectMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected