diff options
-rw-r--r-- | doc/source/index.rst | 2 | ||||
-rw-r--r-- | pbr/git.py | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/doc/source/index.rst b/doc/source/index.rst index 4279041..eea043f 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -174,7 +174,7 @@ for you. Usage ===== -pbr requires a distribution to use distribute. Your distribution +pbr requires a distribution to use setuptools. Your distribution must include a distutils2-like setup.cfg file, and a minimal setup.py script. A simple sample can be found in pbr's own setup.cfg @@ -18,6 +18,7 @@ from __future__ import unicode_literals import distutils.errors from distutils import log +import errno import io import os import re @@ -64,7 +65,13 @@ def _run_git_command(cmd, git_dir, **kwargs): def _get_git_directory(): - return _run_shell_command(['git', 'rev-parse', '--git-dir']) + try: + return _run_shell_command(['git', 'rev-parse', '--git-dir']) + except OSError as e: + if e.errno == errno.ENOENT: + # git not installed. + return '' + raise def _git_is_installed(): |