Skip to main content

normalize_diff_path

Function normalize_diff_path 

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

Normalize a repository-relative path as seen in unified diff headers.

Behavior:

  • trim outer whitespace
  • convert backslashes to forward slashes
  • strip a/ or b/ prefix
  • strip leading ./ (once)