More stable author email extraction.

The email search regular expression in the git-blame output can be tripped
by a similar pattern appearing in the source code. The supplied patch
fixes the problem.

Signed-off-by: Adam Waldenberg <adam.waldenberg@ejwa.se>
This commit is contained in:
Diomidis Spinellis 2014-11-03 10:10:31 +01:00 committed by Adam Waldenberg
parent d6a2f33de5
commit b20f15e794
1 changed files with 2 additions and 2 deletions

View File

@ -143,8 +143,8 @@ class Blame:
@staticmethod
def get_author_email(string):
author_email = re.search(" \((.*?)\d\d\d\d-\d\d-\d\d", string)
return author_email.group(1).strip().lstrip("<").rstrip(">")
author_email = re.search("^[0-9a-f]{8} \(<([^>]*)", string)
return author_email.group(1)
@staticmethod
def get_content(string):