Skip to content

Commit cdf553f

Browse files
committed
fix failed recognition of custom containerfile due to Windows paths being misinterpreted as git urls
Signed-off-by: Metroite <22453965+Metroite@users.noreply.github.com>
1 parent f618ff3 commit cdf553f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

podman_compose.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2834,7 +2834,9 @@ def is_context_git_url(path: str) -> bool:
28342834
return True
28352835
# URL contains a ":" character, a hint of a valid URL
28362836
if r.scheme != "" and r.netloc == "" and r.path != "":
2837-
return True
2837+
# On Windows, this could be a drive letter, so we need to check the scheme
2838+
if not (os.name == "nt" and len(r.scheme) == 1):
2839+
return True
28382840
if r.scheme == "": # tweak path URL to get username from url parser
28392841
r = urllib.parse.urlparse("ssh://" + path)
28402842
if r.username is not None and r.username != "":

0 commit comments

Comments
 (0)