Commit 7d5934e5 by finswimmer Committed by GitHub

Merge pull request #2018 from amarshall/fix-git-url-pattern

Fix non-compliant Git URL matching
parents ed443425 73488935
......@@ -12,8 +12,8 @@ pattern_formats = {
"user": r"[a-zA-Z0-9_.-]+",
"resource": r"[a-zA-Z0-9_.-]+",
"port": r"\d+",
"path": r"[\w\-/\\]+",
"name": r"[\w\-]+",
"path": r"[\w~.\-/\\]+",
"name": r"[\w~.\-]+",
"rev": r"[^@#]+",
}
......
......@@ -21,6 +21,10 @@ from poetry.vcs.git import ParsedUrl
GitUrl("https://user@hostname/project/blah.git", None),
),
(
"git+https://user@hostname/project~_-.foo/blah~_-.bar.git",
GitUrl("https://user@hostname/project~_-.foo/blah~_-.bar.git", None),
),
(
"git+https://user@hostname:project/blah.git",
GitUrl("https://user@hostname/project/blah.git", None),
),
......@@ -99,6 +103,18 @@ def test_normalize_url(url, normalized):
),
),
(
"git+https://user@hostname/project~_-.foo/blah~_-.bar.git",
ParsedUrl(
"https",
"hostname",
"/project~_-.foo/blah~_-.bar.git",
"user",
None,
"blah~_-.bar",
None,
),
),
(
"git+https://user@hostname:project/blah.git",
ParsedUrl(
"https", "hostname", ":project/blah.git", "user", None, "blah", None
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment