summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Stanley <fungi@yuggoth.org>2014-06-05 23:02:58 +0000
committerJeremy Stanley <fungi@yuggoth.org>2014-06-05 23:07:44 +0000
commit654191113e2eb31e57daa4d69aeb3fe052bced5e (patch)
tree35ddf01f4cf9ec07ac166eb927a7a0bac218c9f3
parenta38dc208cf0ed0b06f9ab2e517fc267a6c181b3e (diff)
downloadpbr-654191113e2eb31e57daa4d69aeb3fe052bced5e.tar.gz
Check for git before querying it for a version
* pbr/packaging.py(_get_version_from_git): Wrap calls to _run_git_command in a conditional check for _git_is_installed to avoid an opaque error message which can occur when you have a .git directory but no git executable. Change-Id: I6752c93d393a941daa1e7fb949c7c3d2a75337f3 Closes-Bug: #1326682
-rw-r--r--pbr/packaging.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pbr/packaging.py b/pbr/packaging.py
index d6aeb64..a998ceb 100644
--- a/pbr/packaging.py
+++ b/pbr/packaging.py
@@ -801,7 +801,7 @@ def _get_version_from_git(pre_version):
"""
git_dir = _get_git_directory()
- if git_dir:
+ if git_dir and _git_is_installed():
if pre_version:
try:
return _run_git_command(