[diffoscope] 05/05: presenters.text: Remove superfluous empty newlines from diff.

Chris Lamb chris at chris-lamb.co.uk
Sat Jan 21 12:16:21 CET 2017


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

lamby pushed a commit to branch master
in repository diffoscope.

commit 5197c6e9cf6a7d7d6f7664c5200b0487d6767e7a
Author: Chris Lamb <lamby at debian.org>
Date:   Sat Jan 21 18:05:32 2017 +1100

    presenters.text: Remove superfluous empty newlines from diff.
    
    Signed-off-by: Chris Lamb <lamby at debian.org>
---
 diffoscope/presenters/text.py | 2 +-
 tests/data/output.txt         | 3 ---
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/diffoscope/presenters/text.py b/diffoscope/presenters/text.py
index 111fd3c..971e7c1 100644
--- a/diffoscope/presenters/text.py
+++ b/diffoscope/presenters/text.py
@@ -57,5 +57,5 @@ class TextPresenter(Presenter):
         # unnecessary splitting, interpolating, etc.
         self.print_func(self.RE_PREFIX.sub(
             r'\1{}'.format(self.PREFIX * (self.depth + 0 if raw else -1)),
-            val,
+            val.rstrip(),
         ))
diff --git a/tests/data/output.txt b/tests/data/output.txt
index b515c2c..681ece0 100644
--- a/tests/data/output.txt
+++ b/tests/data/output.txt
@@ -10,7 +10,6 @@
 │ +-rw-r--r--   0 lunar     (1000) lunar     (1000)      671 2015-06-29 15:49:41.000000 dir/text
 │ +crw-r--r--   0 root         (0) root         (0)    1,  3 2015-06-29 15:49:41.000000 dir/null
 │ +lrwxrwxrwx   0 lunar     (1000) lunar     (1000)        0 2015-06-29 15:49:41.000000 dir/link -> really-broken
-│ 
 ├── dir/text
 │ @@ -1,6 +1,12 @@
 │ +A common form of lorem ipsum reads:
@@ -25,10 +24,8 @@
 │ +"Lorem ipsum" text is derived from sections 1.10.32--3 of Cicero's De finibus
 │ +bonorum et malorum (On the Ends of Goods and Evils, or alternatively [About]
 │ +The Purposes of Good and Evil).
-│ 
 ├── dir/link
 │┄ symlink
 │ @@ -1 +1 @@
 │ -destination: broken
 │ +destination: really-broken
-│ 

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


More information about the diffoscope mailing list