pub fn encode_path(path: &str) -> String
Percent-encode each segment of a repository path, keeping the slashes that separate them.