Merge pull request #51169 from twangboy/fix_git_state

More descriptive error when missing GitPython or PyGit2
This commit is contained in:
Daniel Wozniak 2019-01-15 09:37:43 -07:00 committed by GitHub
commit 8920a86f2c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -749,6 +749,12 @@ def latest(name,
ret,
'Failed to check remote refs: {0}'.format(_strip_exc(exc))
)
except NameError as exc:
if 'global name' in exc.message:
raise CommandExecutionError(
'Failed to check remote refs: You may need to install '
'GitPython or PyGit2')
raise
if 'HEAD' in all_remote_refs:
head_rev = all_remote_refs['HEAD']