[Reproducible-commits] [debbindiff] 02/03: Fix diff parser when skipping until the end of a file without a newline

Jérémy Bobbio lunar at moszumanska.debian.org
Sun May 17 14:14:20 UTC 2015


This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch master
in repository debbindiff.

commit 6ee3b7801ab82625c82f7b5050e74d5e377ca85c
Author: Jérémy Bobbio <lunar at debian.org>
Date:   Sun May 17 15:54:29 2015 +0200

    Fix diff parser when skipping until the end of a file without a newline
---
 debbindiff/difference.py | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/debbindiff/difference.py b/debbindiff/difference.py
index 60e552f..c746b64 100644
--- a/debbindiff/difference.py
+++ b/debbindiff/difference.py
@@ -114,14 +114,11 @@ class DiffParser(object):
         return self.read_hunk
 
     def skip_block(self, line):
-        if not line.startswith(self._direction):
+        if self._remaining_hunk_lines == 0 or line[0] != self._direction:
             self._diff += '%s[ %d lines removed ]\n' % (self._direction, self._block_len - MAX_DIFF_BLOCK_LINES)
             return self.read_hunk(line)
         self._block_len += 1
         self._remaining_hunk_lines -= 1
-        if self._remaining_hunk_lines == 0:
-            self._diff += '%s[ %d lines removed ]\n' % (self._direction, self._block_len - MAX_DIFF_BLOCK_LINES)
-            return self.read_headers
         return self.skip_block
 
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/debbindiff.git



More information about the Reproducible-commits mailing list