[diffoscope] 03/10: Fix --max-diff-input-line=0 that got broken with hashing

Jérémy Bobbio lunar at moszumanska.debian.org
Wed Jan 20 16:11:44 CET 2016


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

lunar pushed a commit to branch master
in repository diffoscope.

commit 472a467c834c56bca550f673e2167b4a34f15517
Author: Jérémy Bobbio <lunar at debian.org>
Date:   Wed Jan 20 12:59:16 2016 +0000

    Fix --max-diff-input-line=0 that got broken with hashing
---
 diffoscope/difference.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/diffoscope/difference.py b/diffoscope/difference.py
index 0fedfdc..750c7bd 100644
--- a/diffoscope/difference.py
+++ b/diffoscope/difference.py
@@ -228,6 +228,7 @@ def make_feeder_from_raw_reader(in_file, filter=lambda buf: buf):
         max_lines = Config.general.max_diff_input_lines
         line_count = 0
         end_nl = False
+        h = None
         if max_lines > 0:
             h = hashlib.sha1()
         for buf in in_file:
@@ -235,7 +236,7 @@ def make_feeder_from_raw_reader(in_file, filter=lambda buf: buf):
             out = filter(buf)
             if h:
                 h.update(out)
-            if line_count < max_lines:
+            if max_lines == 0 or line_count < max_lines:
                 out_file.write(out)
             end_nl = buf[-1] == '\n'
         if h and line_count >= max_lines:

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


More information about the diffoscope mailing list