diff options
-rw-r--r-- | git/repo/base.py | 6 | ||||
-rw-r--r-- | git/test/fixtures/blame_incremental | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/git/repo/base.py b/git/repo/base.py index c2bd2a62..af3050bf 100644 --- a/git/repo/base.py +++ b/git/repo/base.py @@ -682,10 +682,12 @@ class Repo(object): data = self.git.blame(rev, '--', file, p=True, incremental=True, stdout_as_string=False, **kwargs) commits = dict() - stream = iter(data.splitlines()) + stream = iter(data.split(b'\n')) while True: line = next(stream) # when exhausted, casues a StopIteration, terminating this function - + if line.strip() == '': + # Skip over empty lines + continue hexsha, orig_lineno, lineno, num_lines = line.split() lineno = int(lineno) num_lines = int(num_lines) diff --git a/git/test/fixtures/blame_incremental b/git/test/fixtures/blame_incremental index 9a0d9e35..67310aec 100644 --- a/git/test/fixtures/blame_incremental +++ b/git/test/fixtures/blame_incremental @@ -7,7 +7,7 @@ committer Sebastian Thiel committer-mail <byronimo@gmail.com> committer-time 1270634931 committer-tz +0200 -summary Used this release for a first beta of the 0.2 branch of development +summary Used this release
for a first beta of the 0.2 branch of development previous 501bf602abea7d21c3dbb409b435976e92033145 AUTHORS filename AUTHORS 82b8902e033430000481eb355733cd7065342037 14 14 1 |