Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
diffoscope
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Reproducible Builds
diffoscope
Commits
644682bb
Commit
644682bb
authored
2 years ago
by
Chris Lamb
Browse files
Options
Downloads
Patches
Plain Diff
Space out file a little.
parent
36820281
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
diffoscope/comparators/utils/compare.py
+6
-0
6 additions, 0 deletions
diffoscope/comparators/utils/compare.py
with
6 additions
and
0 deletions
diffoscope/comparators/utils/compare.py
+
6
−
0
View file @
644682bb
...
...
@@ -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,6 +139,7 @@ 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
)
...
...
@@ -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
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment