Skip to content

Commit

Permalink
handle escaped characters in repositories URL
Browse files Browse the repository at this point in the history
  • Loading branch information
Mauro Antonello committed Nov 16, 2022
1 parent cd95f0f commit e823857
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/poetry/core/vcs/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
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"[^@#]+?"
SUBDIR = r"[\w\-/\\]+"

Expand Down
6 changes: 4 additions & 2 deletions tests/vcs/test_vcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@
GitUrl("https://user@hostname/project/blah.git", None, None),
),
(
"git+https://user@hostname/project~_-.foo/blah~_-.bar.git",
GitUrl("https://user@hostname/project~_-.foo/blah~_-.bar.git", None, None),
"git+https://user@hostname/project%20~_-.foo/blah%20~_-.bar.git",
GitUrl(
"https://user@hostname/project%20~_-.foo/blah%20~_-.bar.git", None, None
),
),
(
"git+https://user@hostname:project/blah.git",
Expand Down

0 comments on commit e823857

Please sign in to comment.