mirror of
https://github.com/openai/codex.git
synced 2026-10-27 18:48:37 +00:00
Fix Windows marketplace add CI failure
This commit is contained in:
@@ -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!(
|
||||
|
||||
Reference in New Issue
Block a user