Check that the repo exists before trying to get a git commit
@@ -225,8 +225,11 @@ class Backend(BaseVCS):
@property
def commit(self):
+ if self.repo_exists():
_, stdout, _ = self.run('git', 'rev-parse', 'HEAD')
return stdout.strip()
+ else:
+ return None
def checkout(self, identifier=None):
"""Checkout to identifier or latest."""
