Tools: Use a safer hostname detection
This commit is contained in:
committed by
Kacper Donat
parent
ee91b41a6f
commit
211ef2d48b
@@ -10,6 +10,7 @@
|
||||
# 2011/02/05: The script was extended to support also Bazaar
|
||||
|
||||
import os, sys, re, time, getopt
|
||||
from urllib.parse import urlparse
|
||||
import xml.sax
|
||||
import xml.sax.handler
|
||||
import xml.sax.xmlreader
|
||||
@@ -275,9 +276,10 @@ class GitControl(VersionControl):
|
||||
match = re.match(r"ssh://\S+?@(\S+)", url)
|
||||
if match is not None:
|
||||
url = "git://%s" % match.group(1)
|
||||
parsed_url = urlparse(url)
|
||||
entryscore = (
|
||||
url == "git://github.com/FreeCAD/FreeCAD.git",
|
||||
"github.com" in url,
|
||||
parsed_url.netloc == "github.com",
|
||||
branch == self.branch,
|
||||
branch == "main",
|
||||
"@" not in url,
|
||||
|
||||
Reference in New Issue
Block a user