Skip to main content

cleanup_path

Function cleanup_path 

Source
pub fn cleanup_path(path: &str) -> &str
Expand description

Git’s cleanup_path from path.c: strip a single leading ./ and any directory separators immediately following it. Internal consecutive slashes (e.g. info//sparse-checkout) are deliberately preserved so the result matches git rev-parse --git-path byte-for-byte.