Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions mbed/mbed.py
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ def clone(self, url, path, rev=None, depth=None, protocol=None, **kwargs):

for _, scm in sorted_scms:
main = True
cache = self.get_cache(url)
cache = self.get_cache(url, scm.name)

# Try to clone with cache ref first
if cache and not os.path.isdir(path):
Expand Down Expand Up @@ -1275,9 +1275,9 @@ def rm_untracked(self):
action("Remove untracked library reference \"%s\"" % f)
os.remove(f)

def get_cache(self, url):
def get_cache(self, url, scm):
up = urlparse(formaturl(url, 'https'))
if self.cache and up and up.netloc and os.path.isdir(os.path.join(self.cache, up.netloc, re.sub(r'^/', '', up.path))):
if self.cache and up and up.netloc and os.path.isdir(os.path.join(self.cache, up.netloc, re.sub(r'^/', '', up.path), '.'+scm)):
return os.path.join(self.cache, up.netloc, re.sub(r'^/', '', up.path))

def set_cache(self, url):
Expand Down