Skip to content

Commit

Permalink
Merge a7f3361 into 8987fc8
Browse files Browse the repository at this point in the history
  • Loading branch information
yakky committed Apr 25, 2023
2 parents 8987fc8 + a7f3361 commit 2353f36
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
1 change: 1 addition & 0 deletions 47.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add parsing variable for user to gitlab parser
1 change: 1 addition & 0 deletions changes/47.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add parsing variable for user to gitlab parser
2 changes: 1 addition & 1 deletion giturlparse/platforms/gitlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class GitLabPlatform(BasePlatform):
r"(?P<path_raw>(/blob/|/-/tree/).+)?)$"
),
"ssh": (
r"(?P<protocols>(git\+)?(?P<protocol>ssh))?(://)?git@(?P<domain>.+?):(?P<port>[0-9]+)?(?(port))?"
r"(?P<protocols>(git\+)?(?P<protocol>ssh))?(://)?(?P<_user>.+?)@(?P<domain>.+?):(?P<port>[0-9]+)?(?(port))?"
r"(?P<pathname>/?(?P<owner>[^/]+)/"
r"(?P<groups_path>.*?)?(?(groups_path)/)?(?P<repo>[^/]+?)(?:(\.git)?(/)?)"
r"(?P<path_raw>(/blob/|/-/tree/).+)?)$"
Expand Down
24 changes: 24 additions & 0 deletions giturlparse/tests/test_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,30 @@
},
),
),
(
"GIT",
(
"joe@github.com-work:nephila/giturlparse.git",
{
"host": "github.com-work",
"resource": "github.com-work",
"user": "joe",
"port": "",
"owner": "nephila",
"repo": "giturlparse",
"name": "giturlparse",
"groups": [],
"path": "",
"path_raw": "",
"pathname": "nephila/giturlparse.git",
"branch": "",
"protocol": "ssh",
"protocols": [],
"github": False,
"platform": "gitlab",
},
),
),
)

INVALID_PARSE_URLS = (
Expand Down

0 comments on commit 2353f36

Please sign in to comment.