[Git][reproducible-builds/diffoscope][master] Prevent an issue where (for example) LibarchiveMember's has_same_content...

Chris Lamb gitlab at salsa.debian.org
Sat May 30 11:27:00 UTC 2020



Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
c15e1f41 by Jean-Romain Garnier at 2020-05-30T12:25:33+01:00
Prevent an issue where (for example) LibarchiveMember's has_same_content method is called regardless of the actual type of file.

Signed-off-by: Chris Lamb <lamby at debian.org>

- - - - -


1 changed file:

- diffoscope/comparators/utils/compare.py


Changes:

=====================================
diffoscope/comparators/utils/compare.py
=====================================
@@ -96,6 +96,11 @@ def compare_files(file1, file2, source=None, diff_content_only=False):
     if any_excluded(file1.name, file2.name):
         return None
 
+    # Specialize the files first so "has_same_content_as" can be overridden
+    # by subclasses
+    specialize(file1)
+    specialize(file2)
+
     force_details = Config().force_details
     with profile("has_same_content_as", file1):
         has_same_content = file1.has_same_content_as(file2)
@@ -111,9 +116,6 @@ def compare_files(file1, file2, source=None, diff_content_only=False):
     elif diff_content_only:
         return Difference(None, file1.name, file2.name, comment="Files differ")
 
-    specialize(file1)
-    specialize(file2)
-
     call_difftool(file1, file2)
 
     if isinstance(file1, MissingFile):



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/c15e1f41b8165d72fd6717ca885747b42c9938fc

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/c15e1f41b8165d72fd6717ca885747b42c9938fc
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/20200530/ea620549/attachment.htm>


More information about the rb-commits mailing list