Skip to content

Commit

Permalink
feat(git): Silently omit git if unavailable
Browse files Browse the repository at this point in the history
  • Loading branch information
nirizr committed Feb 22, 2018
1 parent 78a26e0 commit 2d97137
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions coveralls/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,13 @@ def git_info():
}]
}
"""
# silently omit the optional 'git' API argument if a simple git status
# command fails, suggesting git is unavailable
try:
run_command('git', 'status')
except CoverallsException:
return {}

rev = run_command('git', 'rev-parse', '--abbrev-ref', 'HEAD').strip()
remotes = run_command('git', 'remote', '-v').splitlines()

Expand Down

0 comments on commit 2d97137

Please sign in to comment.