Skip to content

Commit

Permalink
Merge pull request astropy#17 from mdboom/faster-get-git-devstr
Browse files Browse the repository at this point in the history
Don't call out to git if we're sure it will fail
  • Loading branch information
astrofrog committed May 23, 2014
2 parents 1f6aac5 + 6cac506 commit 7793b28
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions astropy_helpers/git_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ def get_git_devstr(sha=False, show_warning=True, path=None):
if not os.path.isdir(path):
path = os.path.abspath(os.path.dirname(path))

if not os.path.exists(os.path.join(path, '.git')):
return ''

if sha:
cmd = ['rev-parse'] # Faster for getting just the hash of HEAD
else:
Expand Down

0 comments on commit 7793b28

Please sign in to comment.