[diffoscope] 01/02: Run current diff parsing handler one more time at the end of input
Jérémy Bobbio
lunar at moszumanska.debian.org
Fri Dec 18 15:44:59 CET 2015
This is an automated email from the git hooks/post-receive script.
lunar pushed a commit to branch master
in repository diffoscope.
commit a8d8c57be551cfc144c256a170c253c7f8dbf7b2
Author: Jérémy Bobbio <lunar at debian.org>
Date: Fri Dec 18 14:24:01 2015 +0000
Run current diff parsing handler one more time at the end of input
If we are currently skipping a block (because it was too long), we need to run
the skip_block handler a final time so it can output the final 'line skipped'
message. Otherwise, we would return silently ignoring lines.
Thanks for Mike Hommey for reporting the issue.
---
diffoscope/difference.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/diffoscope/difference.py b/diffoscope/difference.py
index 554e29e..d418d4e 100644
--- a/diffoscope/difference.py
+++ b/diffoscope/difference.py
@@ -58,6 +58,7 @@ class DiffParser(object):
def parse(self):
for line in self._output.readlines():
self._action = self._action(line.decode('utf-8', errors='replace'))
+ self._action('')
self._success = True
self._output.close()
@@ -82,7 +83,9 @@ class DiffParser(object):
return self.read_hunk
def read_hunk(self, line):
- if line[0] == ' ':
+ if not line:
+ return None
+ elif line[0] == ' ':
self._remaining_hunk_lines -= 2
elif line[0] == '+':
self._remaining_hunk_lines -= 1
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git
More information about the diffoscope
mailing list