[Reproducible-commits] [debbindiff] 04/09: Properly output diffs when one of the file is empty
Jérémy Bobbio
lunar at moszumanska.debian.org
Sun Feb 15 11:29:54 UTC 2015
This is an automated email from the git hooks/post-receive script.
lunar pushed a commit to annotated tag 9
in repository debbindiff.
commit a14d859b0a61fac8178e47a127fa056b8021cc5c
Author: Jérémy Bobbio <lunar at debian.org>
Date: Sun Feb 15 10:15:40 2015 +0000
Properly output diffs when one of the file is empty
---
debbindiff/presenters/html.py | 5 +++--
debbindiff/presenters/text.py | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/debbindiff/presenters/html.py b/debbindiff/presenters/html.py
index 835da0b..b6ffafa 100644
--- a/debbindiff/presenters/html.py
+++ b/debbindiff/presenters/html.py
@@ -229,8 +229,9 @@ def output_difference(difference, print_func):
if difference.comment:
print_func("<div class='comment'>%s</div>"
% escape(difference.comment).replace('\n', '<br />'))
- if difference.lines1 and difference.lines2:
- print_func(create_diff(difference.lines1, difference.lines2))
+ if difference.lines1 or difference.lines2:
+ print_func(create_diff(difference.lines1 or ['<empty>'],
+ difference.lines2 or ['<empty>']))
for detail in difference.details:
output_difference(detail, print_func)
except PrintLimitReached:
diff --git a/debbindiff/presenters/text.py b/debbindiff/presenters/text.py
index d973b57..5330439 100644
--- a/debbindiff/presenters/text.py
+++ b/debbindiff/presenters/text.py
@@ -26,7 +26,7 @@ def print_difference(difference, print_func):
if difference.comment:
for line in difference.comment.split('\n'):
print_func("│┄ %s" % line)
- if difference.lines1 and difference.lines2:
+ if difference.lines1 or difference.lines2:
for line in difflib.unified_diff(difference.lines1, difference.lines2):
if line.startswith('--- ') or line.startswith('+++ '):
continue
--
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