Skip to content

Commit 070b195

Browse files
committed
Fixed issue where None is compared to string during hash comparison (e.g. local fresh repo has first commit)
1 parent df401d6 commit 070b195

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mbed/mbed.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -724,8 +724,9 @@ def write(self):
724724
with open(self.lib) as f:
725725
lib_repo = Repo.fromurl(f.read().strip())
726726
if (formaturl(lib_repo.url, 'https') == formaturl(self.url, 'https') # match URLs in common format (https)
727-
and (lib_repo.hash == self.hash # match hashes, even if hash is None (valid for repos with no revisions)
728-
or lib_repo.hash == self.hash[0:len(lib_repo.hash)])): # match long and short hash formats
727+
and (lib_repo.hash == self.hash # match hashes, even if hash is None (valid for repos with no revisions)
728+
or (lib_repo.hash and self.hash
729+
and lib_repo.hash == self.hash[0:len(lib_repo.hash)]))): # match long and short hash formats
729730
#print self.name, 'unmodified'
730731
progress()
731732
return

0 commit comments

Comments
 (0)