mirror of
https://github.com/ejwa/gitinspector.git
synced 2025-01-03 11:22:15 +01:00
Prevent ZeroDivisionError in get_stability method (Fixes #63).
Signed-off-by: Adam Waldenberg <adam.waldenberg@ejwa.se>
This commit is contained in:
parent
30a20e6b52
commit
96e2b0fdf0
1 changed files with 2 additions and 2 deletions
|
@ -172,8 +172,8 @@ class Blame:
|
|||
@staticmethod
|
||||
def get_stability(author, blamed_rows, changes):
|
||||
if author in changes.get_authorinfo_list():
|
||||
return 100.0 * blamed_rows / changes.get_authorinfo_list()[author].insertions
|
||||
|
||||
author_insertions = changes.get_authorinfo_list()[author].insertions
|
||||
return 100 if author_insertions == 0 else 100.0 * blamed_rows / author_insertions
|
||||
return 100
|
||||
|
||||
@staticmethod
|
||||
|
|
Loading…
Reference in a new issue