Merge pull request #48689 from linoplt/fix_38310_pygit2_checkout_ext_pillar_remote_using_tag

Fix ext_pillar remote checkout using tag (pygit2)
This commit is contained in:
Nicole Thomas 2018-07-31 12:15:58 -04:00 committed by GitHub
commit 00d06bda76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1534,9 +1534,9 @@ class Pygit2(GitProvider):
elif tag_ref in refs:
tag_obj = self.repo.revparse_single(tag_ref)
if not isinstance(tag_obj, pygit2.Tag):
if not isinstance(tag_obj, pygit2.Commit):
log.error(
'%s does not correspond to pygit2.Tag object',
'%s does not correspond to pygit2.Commit object',
tag_ref
)
else:
@ -1556,9 +1556,10 @@ class Pygit2(GitProvider):
exc_info=True
)
return None
log.debug('SHA of tag %s: %s', tgt_ref, tag_sha)
if head_sha != target_sha:
if not _perform_checkout(local_ref, branch=False):
if head_sha != tag_sha:
if not _perform_checkout(tag_ref, branch=False):
return None
# Return the relative root, if present