bitbake: fetch2/git: _revision_key: collapse adjacent slashes

>From a SRCREV caching point of view, there is no reason to treat the
following upstreams as different:

    SRC_URI = "git://github.com/file/file.git"
    SRC_URI = "git://github.com//file/file.git"

(Bitbake rev: 425e21c14955dd38868c6e97637df3bbe0f89fac)

Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Chris Laplante
2020-01-16 11:28:04 -05:00
committed by Richard Purdie
parent 065ab5dce0
commit 96adf215cc

View File

@@ -594,7 +594,9 @@ class Git(FetchMethod):
"""
Return a unique key for the url
"""
return "git:" + ud.host + ud.path.replace('/', '.') + ud.unresolvedrev[name]
# Collapse adjacent slashes
slash_re = re.compile(r"/+")
return "git:" + ud.host + slash_re.sub(".", ud.path) + ud.unresolvedrev[name]
def _lsremote(self, ud, d, search):
"""