mirror of
https://github.com/ejwa/gitinspector.git
synced 2025-01-08 21:51:54 +01:00
The blame module was not behaving quite right when used with "--since".
It was not taking the caret (^) character into consideration when --since was being specified, something which resulted in an excess of attributed rows. With this easy fix, the behavior should now be "correct".
This commit is contained in:
parent
e7d69d78aa
commit
c96d3c3ffe
1 changed files with 5 additions and 1 deletions
|
@ -62,7 +62,7 @@ class BlameThread(threading.Thread):
|
|||
|
||||
for j in git_blame_r.readlines():
|
||||
j = j.decode("utf-8", "replace")
|
||||
if Blame.is_blame_line(j):
|
||||
if Blame.is_blame_line(j) and not (Blame.is_prior(j) and interval.get_since()):
|
||||
email = Blame.get_author_email(j)
|
||||
author = self.changes.get_latest_author_by_email(email)
|
||||
content = Blame.get_content(j)
|
||||
|
@ -120,6 +120,10 @@ class Blame:
|
|||
def is_blame_line(string):
|
||||
return string.find(" (") != -1
|
||||
|
||||
@staticmethod
|
||||
def is_prior(string):
|
||||
return string[0] == "^"
|
||||
|
||||
@staticmethod
|
||||
def get_author_email(string):
|
||||
author_email = re.search(" \((.*?)\d\d\d\d-\d\d-\d\d", string)
|
||||
|
|
Loading…
Reference in a new issue