Function git_path::to_unix_separators_on_windows
source · Expand description
Replaces windows path separators with slashes, but only do so on windows.
Examples found in repository?
src/spec.rs (line 43)
39 40 41 42 43 44 45 46 47 48 49 50 51 52
pub fn apply_prefix(&mut self, prefix: &std::path::Path) -> &Self {
// many more things we can't handle. `Path` never ends with trailing path separator.
let prefix = crate::into_bstr(prefix);
if !prefix.is_empty() {
let mut prefix = crate::to_unix_separators_on_windows(prefix);
{
let path = prefix.to_mut();
path.push_byte(b'/');
path.extend_from_slice(&self.0);
}
self.0 = prefix.into_owned();
}
self
}