mirror of
https://github.com/ejwa/gitinspector.git
synced 2024-09-27 18:01:30 +02: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
@ -62,7 +62,7 @@ class BlameThread(threading.Thread):
|
|||||||
|
|
||||||
for j in git_blame_r.readlines():
|
for j in git_blame_r.readlines():
|
||||||
j = j.decode("utf-8", "replace")
|
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)
|
email = Blame.get_author_email(j)
|
||||||
author = self.changes.get_latest_author_by_email(email)
|
author = self.changes.get_latest_author_by_email(email)
|
||||||
content = Blame.get_content(j)
|
content = Blame.get_content(j)
|
||||||
@ -120,6 +120,10 @@ class Blame:
|
|||||||
def is_blame_line(string):
|
def is_blame_line(string):
|
||||||
return string.find(" (") != -1
|
return string.find(" (") != -1
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def is_prior(string):
|
||||||
|
return string[0] == "^"
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_author_email(string):
|
def get_author_email(string):
|
||||||
author_email = re.search(" \((.*?)\d\d\d\d-\d\d-\d\d", string)
|
author_email = re.search(" \((.*?)\d\d\d\d-\d\d-\d\d", string)
|
||||||
|
Loading…
Reference in New Issue
Block a user