Fix fallback to unshallowing shallow clone

Currently git may not find the correct commit with depth=1000000 and shallow clone, caused by an error in the final fall back if clause. The comment in the if clause is correct, just missing a 'not' operator for the comment / behavior to work.
pull/70252/head
Elmeri Niemelä 4 years ago committed by Elmeri Niemelä
parent 3e82ed307b
commit f6c30fedf4

@ -898,7 +898,7 @@ def fetch(git_path, module, repo, dest, version, remote, depth, bare, refspec, g
refspecs.append('+refs/heads/%s:refs/remotes/%s/%s' % (version, remote, version))
elif is_remote_tag(git_path, module, dest, repo, version):
refspecs.append('+refs/tags/' + version + ':refs/tags/' + version)
if refspecs:
if not refspecs:
# if refspecs is empty, i.e. version is neither heads nor tags
# assume it is a version hash
# fall back to a full clone, otherwise we might not be able to checkout

Loading…
Cancel
Save