Treat Windows drive paths as local copy endpoints
ci / test (push) Canceled after 0s
ci / fuzz-smoke (push) Canceled after 0s
ci / windows-client (push) Canceled after 0s
ci / package-release (linux-x86_64, ubuntu-latest, , , ) (push) Canceled after 0s
ci / package-release (macos-aarch64, macos-14, , , ) (push) Canceled after 0s
ci / package-release (macos-x86_64, macos-13, , , ) (push) Canceled after 0s
ci / package-release (windows-aarch64, windows-latest, aarch64, windows, aarch64-pc-windows-msvc) (push) Canceled after 0s
ci / package-release (windows-x86_64, windows-latest, , , ) (push) Canceled after 0s
ci / remote-bench (push) Canceled after 0s
ci / publish-gitea-release (push) Canceled after 0s
ci / test (push) Canceled after 0s
ci / fuzz-smoke (push) Canceled after 0s
ci / windows-client (push) Canceled after 0s
ci / package-release (linux-x86_64, ubuntu-latest, , , ) (push) Canceled after 0s
ci / package-release (macos-aarch64, macos-14, , , ) (push) Canceled after 0s
ci / package-release (macos-x86_64, macos-13, , , ) (push) Canceled after 0s
ci / package-release (windows-aarch64, windows-latest, aarch64, windows, aarch64-pc-windows-msvc) (push) Canceled after 0s
ci / package-release (windows-x86_64, windows-latest, , , ) (push) Canceled after 0s
ci / remote-bench (push) Canceled after 0s
ci / publish-gitea-release (push) Canceled after 0s
This commit is contained in:
@@ -263,10 +263,7 @@ pub fn ensure_relative_child(path: &Path) -> Result<String> {
|
|||||||
|
|
||||||
fn looks_like_windows_path(raw: &str) -> bool {
|
fn looks_like_windows_path(raw: &str) -> bool {
|
||||||
let bytes = raw.as_bytes();
|
let bytes = raw.as_bytes();
|
||||||
bytes.len() >= 3
|
bytes.len() >= 2 && bytes[0].is_ascii_alphabetic() && bytes[1] == b':'
|
||||||
&& bytes[0].is_ascii_alphabetic()
|
|
||||||
&& bytes[1] == b':'
|
|
||||||
&& (bytes[2] == b'\\' || bytes[2] == b'/')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
@@ -314,6 +311,14 @@ mod tests {
|
|||||||
parse_copy_endpoint("C:\\Users\\palav\\x"),
|
parse_copy_endpoint("C:\\Users\\palav\\x"),
|
||||||
CopyEndpoint::Local(PathBuf::from("C:\\Users\\palav\\x"))
|
CopyEndpoint::Local(PathBuf::from("C:\\Users\\palav\\x"))
|
||||||
);
|
);
|
||||||
|
assert_eq!(
|
||||||
|
parse_copy_endpoint("C:/Users/palav/x"),
|
||||||
|
CopyEndpoint::Local(PathBuf::from("C:/Users/palav/x"))
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
parse_copy_endpoint("C:relative\\x"),
|
||||||
|
CopyEndpoint::Local(PathBuf::from("C:relative\\x"))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
Reference in New Issue
Block a user