Skip to content

Commit 54a779f

Browse files
committed
Strip out parasite .git and .hg suffixes in repo URLs
1 parent b4270f2 commit 54a779f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mbed/mbed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,7 @@ def fromurl(cls, url, path=None):
982982
repo.rev = m_bld_ref.group(8)
983983
repo.is_build = True
984984
elif m_repo_ref:
985-
repo.name = os.path.basename(path or m_repo_ref.group(2))
985+
repo.name = re.sub(r'\.(git|hg)/?$', '', os.path.basename(path or m_repo_ref.group(2)))
986986
repo.path = os.path.abspath(path or os.path.join(getcwd(), repo.name))
987987
repo.url = formaturl(m_repo_ref.group(1))
988988
repo.rev = m_repo_ref.group(3)

0 commit comments

Comments
 (0)