diff --git a/project.py b/project.py index 22184578..127176e5 100644 --- a/project.py +++ b/project.py @@ -1103,17 +1103,12 @@ class Project(object): elif self.manifest.default.sync_c: current_branch_only = True - is_sha1 = False - if ID_RE.match(self.revisionExpr) is not None: - is_sha1 = True - if is_sha1 and self._CheckForSha1(): - # Don't need to fetch since we already have this revision - return True - - if not self._RemoteFetch(initial=is_new, quiet=quiet, alt_dir=alt_dir, - current_branch_only=current_branch_only, - no_tags=no_tags): - return False + has_sha1 = ID_RE.match(self.revisionExpr) and self._CheckForSha1() + if (not has_sha1 #Need to fetch since we don't already have this revision + and not self._RemoteFetch(initial=is_new, quiet=quiet, alt_dir=alt_dir, + current_branch_only=current_branch_only, + no_tags=no_tags)): + return False if self.worktree: self._InitMRef()