Skip to content

Commit 4ff530c

Browse files
committed
Check whether the cached repo scm matches the clone scm
1 parent 75900ee commit 4ff530c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mbed/mbed.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,7 @@ def clone(self, url, path, rev=None, depth=None, protocol=None, **kwargs):
11921192

11931193
for _, scm in sorted_scms:
11941194
main = True
1195-
cache = self.get_cache(url)
1195+
cache = self.get_cache(url, scm.name)
11961196

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

1278-
def get_cache(self, url):
1278+
def get_cache(self, url, scm):
12791279
up = urlparse(formaturl(url, 'https'))
1280-
if self.cache and up and up.netloc and os.path.isdir(os.path.join(self.cache, up.netloc, re.sub(r'^/', '', up.path))):
1280+
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)):
12811281
return os.path.join(self.cache, up.netloc, re.sub(r'^/', '', up.path))
12821282

12831283
def set_cache(self, url):

0 commit comments

Comments
 (0)