[diffoscope] 10/10: diff: updated regex to match lines with only a '\n' char

Juliana Oliveira jwnx-guest at moszumanska.debian.org
Mon Jan 29 03:43:23 CET 2018

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

jwnx-guest pushed a commit to branch jwnx_subprocess_merge
in repository diffoscope.

commit 199178b03ff55b1f1f723f224f68b77ec596a7cd
Author: Juliana Oliveira <juliana.orod at gmail.com>
Date:   Mon Jan 29 00:08:40 2018 -0200

    diff: updated regex to match lines with only a '\n' char
    Diff lines containing only a '\n' were not being caught by DiffParser's
    RANGE_RE regex.
    Signed-off-by: Juliana Oliveira <juliana.orod at gmail.com>
 diffoscope/diff.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/diffoscope/diff.py b/diffoscope/diff.py
index 5664caa..a0dbc93 100644
--- a/diffoscope/diff.py
+++ b/diffoscope/diff.py
@@ -42,7 +42,7 @@ re_diff_change = re.compile(r'^([+-@]).*', re.MULTILINE)
 class DiffParser(object):
     RANGE_RE = re.compile(
-        r'^@@\s+-(?P<start1>\d+)(,(?P<len1>\d+))?\s+\+(?P<start2>\d+)(,(?P<len2>\d+))?\s+@@$',
+        r'(^ *\n$)|(^@@\s+-(?P<start1>\d+)(,(?P<len1>\d+))?\s+\+(?P<start2>\d+)(,(?P<len2>\d+))?\s+@@$)',
     def __init__(self, output, end_nl_q1, end_nl_q2):

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

More information about the diffoscope mailing list