Skip to content

Commit fd2e5c4

Browse files
committed
Fix BitBucket regex
user@ is optional for HTTPS URLs. Fixes #107
1 parent b647270 commit fd2e5c4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

giturlparse/platforms/bitbucket.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
class BitbucketPlatform(BasePlatform):
55
PATTERNS = {
66
"https": (
7-
r"(?P<protocols>(git\+)?(?P<protocol>https))://(?P<_user>.+)@(?P<domain>.+?)"
7+
r"(?P<protocols>(git\+)?(?P<protocol>https))://(?:(?P<_user>.+)@)?(?P<domain>.+?)"
88
r"(?P<pathname>/(?P<owner>.+)/(?P<repo>.+?)(?:\.git)?)$"
99
),
1010
"ssh": (
@@ -16,5 +16,5 @@ class BitbucketPlatform(BasePlatform):
1616
"https": r"https://%(owner)s@%(domain)s/%(owner)s/%(repo)s%(dot_git)s",
1717
"ssh": r"git@%(domain)s:%(owner)s/%(repo)s%(dot_git)s",
1818
}
19-
DOMAINS = ("bitbucket.org",)
19+
DOMAINS = ("bitbucket.org", "bitbucket.com")
2020
DEFAULTS = {"_user": "git"}

0 commit comments

Comments
 (0)