Merge pull request #42399 from rallytime/fix-42381

Update old "ref" references to "rev" in git.detached state
This commit is contained in:
garethgreenaway 2017-07-21 12:38:58 -07:00 committed by GitHub
commit 0b3179135c

View file

@ -2213,7 +2213,7 @@ def detached(name,
# Determine if supplied ref is a hash
remote_rev_type = 'ref'
if len(ref) <= 40 \
if len(rev) <= 40 \
and all(x in string.hexdigits for x in rev):
rev = rev.lower()
remote_rev_type = 'hash'
@ -2419,7 +2419,7 @@ def detached(name,
https_pass=https_pass,
ignore_retcode=False)
if 'refs/remotes/'+remote+'/'+ref in all_remote_refs:
if 'refs/remotes/'+remote+'/'+rev in all_remote_refs:
checkout_commit_id = all_remote_refs['refs/remotes/' + remote + '/' + rev]
elif 'refs/tags/' + rev in all_remote_refs:
checkout_commit_id = all_remote_refs['refs/tags/' + rev]