Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita0788e0

Browse files
ghickmanByron
authored andcommitted
Ignore all lines of subsequent hunks until last one is found
Git version 2.11.1+ introduced extra lines into the subsequent hunksections for incremental blame output. The documentation notes thatparsers of this output should ignore all lines between the start and endfor robust parsing.
1 parent830070d commita0788e0

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

‎git/repo/base.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -713,11 +713,14 @@ def blame_incremental(self, rev, file, **kwargs):
713713
committed_date=int(props[b'committer-time']))
714714
commits[hexsha]=c
715715
else:
716-
# Discard the next line (it's a filename end tag)
717-
line=next(stream)
718-
tag,value=line.split(b' ',1)
719-
asserttag==b'filename','Unexpected git blame output'
720-
orig_filename=value
716+
# Discard all lines until we find "filename" which is
717+
# guaranteed to be the last line
718+
whileTrue:
719+
line=next(stream)
720+
tag,value=line.split(b' ',1)
721+
iftag==b'filename':
722+
orig_filename=value
723+
break
721724

722725
yieldBlameEntry(commits[hexsha],
723726
range(lineno,lineno+num_lines),

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp