[Git][reproducible-builds/diffoscope][master] 2 commits: Space out file a little.

Chris Lamb (@lamby) gitlab at salsa.debian.org
Fri Jul 29 16:56:01 UTC 2022



Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
644682bb by Chris Lamb at 2022-07-29T09:49:58-07:00
Space out file a little.

- - - - -
b6a4190d by Chris Lamb at 2022-07-29T09:52:32-07:00
Fix a regression introduced in diffoscope version 207 where diffoscope would crash if one directory contained a directory that wasn't in the other. Thanks to Alderico Gallo for the testcase. (Closes: reproducible-builds/diffoscope#310)

- - - - -


1 changed file:

- diffoscope/comparators/utils/compare.py


Changes:

=====================================
diffoscope/comparators/utils/compare.py
=====================================
@@ -120,8 +120,10 @@ def compare_files(file1, file2, source=None, diff_content_only=False):
                 "has_same_content_as returned True; skipping further comparisons"
             )
             return None
+
         if diff_content_only:
             return None
+
     elif diff_content_only:
         return Difference(file1.name, file2.name, comment="Files differ")
 
@@ -137,10 +139,11 @@ def compare_files(file1, file2, source=None, diff_content_only=False):
         and (not file1.is_directory() and not file2.is_directory())
     ):
         return file1.compare_bytes(file2, source)
+
     with profile("compare_files (cumulative)", file1):
         if file2.is_directory():
             difference = file2.compare(file1, source)
-            if difference is not None:
+            if isinstance(difference, Difference):
                 difference = difference.get_reverse()
             return difference
         return file1.compare(file2, source)
@@ -169,6 +172,7 @@ def compare_binary_files(file1, file2, source=None):
     try:
         if source is None:
             source = [file1.name, file2.name]
+
         return Difference.from_operation(
             Xxd,
             file1.path,
@@ -189,9 +193,11 @@ def compare_binary_files(file1, file2, source=None):
 
 def hexdump_fallback(path):
     hexdump = io.StringIO()
+
     with open(path, "rb") as f:
         for buf in iter(lambda: f.read(32), b""):
             hexdump.write(
                 "{}\n".format(binascii.hexlify(buf).decode("us-ascii"))
             )
+
     return hexdump.getvalue()



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/36820281ad5388a29a5a86200071116a4262de1f...b6a4190d1ed1c0bfff9898096d14c1c9649b3206

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/36820281ad5388a29a5a86200071116a4262de1f...b6a4190d1ed1c0bfff9898096d14c1c9649b3206
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20220729/95ffceae/attachment.htm>


More information about the rb-commits mailing list