File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ Fix Bitbucket url parse and add bitbucket.com to recognized domains
Original file line number Diff line number Diff line change @@ -52,7 +52,9 @@ def parse(url, check_domain=True):
5252 parsed_info .update (platform .DEFAULTS )
5353
5454 # Get matches as dictionary
55- matches = platform .clean_data (match .groupdict (default = "" ))
55+ matches = platform .clean_data (
56+ {k : v if v is not None else platform .DEFAULTS .get (k , "" ) for k , v in match .groupdict ().items ()}
57+ )
5658
5759 # Update info with matches
5860 parsed_info .update (matches )
Original file line number Diff line number Diff line change 44class 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" }
Original file line number Diff line number Diff line change 273273 },
274274 ),
275275 ),
276+ (
277+ "HTTPS" ,
278+ (
279+ "https://bitbucket.org/Org/Repo.git" ,
280+ {
281+ "host" : "bitbucket.org" ,
282+ "resource" : "bitbucket.org" ,
283+ "user" : "git" ,
284+ "port" : "" ,
285+ "owner" : "Org" ,
286+ "repo" : "Repo" ,
287+ "name" : "Repo" ,
288+ "groups" : [],
289+ "path" : "" ,
290+ "path_raw" : "" ,
291+ "pathname" : "/Org/Repo.git" ,
292+ "branch" : "" ,
293+ "protocol" : "https" ,
294+ "protocols" : ["https" ],
295+ "platform" : "bitbucket" ,
296+ },
297+ ),
298+ ),
299+ (
300+ "HTTPS" ,
301+ (
302+ "https://bitbucket.org/Org/Repo" ,
303+ {
304+ "host" : "bitbucket.org" ,
305+ "resource" : "bitbucket.org" ,
306+ "user" : "git" ,
307+ "port" : "" ,
308+ "owner" : "Org" ,
309+ "repo" : "Repo" ,
310+ "name" : "Repo" ,
311+ "groups" : [],
312+ "path" : "" ,
313+ "path_raw" : "" ,
314+ "pathname" : "/Org/Repo" ,
315+ "branch" : "" ,
316+ "protocol" : "https" ,
317+ "protocols" : ["https" ],
318+ "platform" : "bitbucket" ,
319+ },
320+ ),
321+ ),
322+ (
323+ "HTTPS" ,
324+ (
325+ "https://bitbucket.com/Org/Repo" ,
326+ {
327+ "host" : "bitbucket.com" ,
328+ "resource" : "bitbucket.com" ,
329+ "user" : "git" ,
330+ "port" : "" ,
331+ "owner" : "Org" ,
332+ "repo" : "Repo" ,
333+ "name" : "Repo" ,
334+ "groups" : [],
335+ "path" : "" ,
336+ "path_raw" : "" ,
337+ "pathname" : "/Org/Repo" ,
338+ "branch" : "" ,
339+ "protocol" : "https" ,
340+ "protocols" : ["https" ],
341+ "platform" : "bitbucket" ,
342+ },
343+ ),
344+ ),
276345 # Gitlab
277346 (
278347 "SSH" ,
You can’t perform that action at this time.
0 commit comments