Skip to content

Commit 6c3867a

Browse files
committed
Issue #15: fix the parse failure problem with commit hash with leading caret.
1 parent 662cf5e commit 6c3867a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

git-blame.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,9 @@ def parse_blame(self, blame):
275275
def prepare_pattern(self):
276276
'''Prepares the regex pattern to parse git blame output.
277277
'''
278-
p_sha = r'(?P<sha>\w+)'
278+
# The SHA output by git-blame may have a leading caret to indicate
279+
# that it is a "boundary commit".
280+
p_sha = r'(?P<sha>\^?\w+)'
279281
p_author = r'(?P<author>.+?)'
280282
p_date = r'(?P<date>\d{4}-\d{2}-\d{2})'
281283
p_time = r'(?P<time>\d{2}:\d{2}:\d{2})'

0 commit comments

Comments
 (0)