Merge pull request #42471 from rallytime/bp-42399

Back-port #42399 to 2017.7.1
This commit is contained in:
garethgreenaway 2017-07-24 08:09:49 -07:00 committed by GitHub
commit 3d1a2d3f9f

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]