Commit 1b2d47d2 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

commits_since may fail

parent d450e0a7
......@@ -249,8 +249,11 @@ class Project(Links, NamedModel, TimeStampedModel):
self.save()
def commits_since(self):
commits = self.git().git.rev_list(f'v{self.version}..{self.main_branch()}')
return len(commits.split('\n')) if commits else 0
try:
commits = self.git().git.rev_list(f'v{self.version}..{self.main_branch()}')
return len(commits.split('\n')) if commits else 0
except git.exc.GitCommandError:
pass
def open_issues(self):
return query_sum(self.repo_set, 'open_issues')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment