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

Commit73ab287

Browse files
committed
Split lines by new line characters
Opt to split lines by the new line character instead of letting`splitlines()` do this. This helps catch the issue when there arespecial characters in the line, particular the commit summary section.
1 parent7a8f96c commit73ab287

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

‎git/repo/base.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -682,10 +682,12 @@ def blame_incremental(self, rev, file, **kwargs):
682682
data=self.git.blame(rev,'--',file,p=True,incremental=True,stdout_as_string=False,**kwargs)
683683
commits=dict()
684684

685-
stream=iter(data.splitlines())
685+
stream=iter(data.split(b'\n'))
686686
whileTrue:
687687
line=next(stream)# when exhausted, casues a StopIteration, terminating this function
688-
688+
ifline.strip()=='':
689+
# Skip over empty lines
690+
continue
689691
hexsha,orig_lineno,lineno,num_lines=line.split()
690692
lineno=int(lineno)
691693
num_lines=int(num_lines)

‎git/test/fixtures/blame_incremental

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ committer Sebastian Thiel
77
committer-mail <byronimo@gmail.com>
88
committer-time 1270634931
99
committer-tz +0200
10-
summary Used this release for a first beta of the 0.2 branch of development
10+
summary Used this release for a first beta of the 0.2 branch of development
1111
previous 501bf602abea7d21c3dbb409b435976e92033145 AUTHORS
1212
filename AUTHORS
1313
82b8902e033430000481eb355733cd7065342037 14 14 1

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp