Skip to content

Commit 76bde60

Browse files
committed
Correcty match Git authentication in URL references
1 parent 999d946 commit 76bde60

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mbed/mbed.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,9 +1381,9 @@ def formaturl(url, format="default"):
13811381
if format == "ssh":
13821382
url = 'ssh://%s%s/%s.git' % (m.group(2) or 'git@', m.group(6), m.group(7))
13831383
elif format == "http":
1384-
url = 'http://%s%s/%s' % (m.group(2) if m.group(5) or m.group(3) != 'git' else '', m.group(6), m.group(7))
1384+
url = 'http://%s%s/%s' % (m.group(2) if (m.group(2) and (m.group(5) or m.group(3) != 'git')) else '', m.group(6), m.group(7))
13851385
elif format == "https":
1386-
url = 'https://%s%s/%s' % (m.group(2) if m.group(5) or m.group(3) != 'git' else '', m.group(6), m.group(7))
1386+
url = 'https://%s%s/%s' % (m.group(2) if (m.group(2) and (m.group(5) or m.group(3) != 'git')) else '', m.group(6), m.group(7))
13871387
else:
13881388
m = re.match(regex_hg_url, url)
13891389
if m:

0 commit comments

Comments
 (0)