Fix Windows marketplace add CI failure

This commit is contained in:
Eric Traut
2026-04-10 21:42:29 -07:00
parent 824ec94eab
commit 27b3a900a2
2 changed files with 50 additions and 1 deletions
+18
View File
@@ -262,12 +262,15 @@ fn normalize_git_url(url: &str) -> String {
}
fn looks_like_local_path(source: &str) -> bool {
let bytes = source.as_bytes();
source.starts_with("./")
|| source.starts_with("../")
|| source.starts_with('/')
|| source.starts_with('\\')
|| source.starts_with("~/")
|| source == "."
|| source == ".."
|| matches!(bytes, [drive, b':', b'/' | b'\\', ..] if drive.is_ascii_alphabetic())
}
fn is_ssh_git_url(source: &str) -> bool {
@@ -503,6 +506,21 @@ mod tests {
);
}
#[test]
fn windows_absolute_path_source_is_rejected_as_local() {
let err = parse_marketplace_source(
r"C:\Users\runneradmin\AppData\Local\Temp\marketplace",
/*explicit_ref*/ None,
)
.unwrap_err();
assert!(
err.to_string()
.contains("local marketplace sources are not supported yet"),
"unexpected error: {err}"
);
}
#[test]
fn ssh_url_parses_as_git_url() {
assert_eq!(