diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-28 15:08:40 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-28 15:08:40 +0300 |
commit | 24e7d185395af41290e5622cad160b7efe230145 (patch) | |
tree | 61c2c5d429caf996bb71c2b617273c04e7946218 /app/models/diff_viewer | |
parent | a2ee63d924727701913f1fc9572f1182f40fda23 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/diff_viewer')
-rw-r--r-- | app/models/diff_viewer/image.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/diff_viewer/image.rb b/app/models/diff_viewer/image.rb index 62a3446a7b6..fca6c664196 100644 --- a/app/models/diff_viewer/image.rb +++ b/app/models/diff_viewer/image.rb @@ -10,5 +10,13 @@ module DiffViewer self.binary = true self.switcher_icon = 'doc-image' self.switcher_title = _('image diff') + + def self.can_render?(diff_file, verify_binary: true) + # When both blobs are missing, we often still have a textual diff that can + # be displayed + return false if diff_file.old_blob.nil? && diff_file.new_blob.nil? + + super + end end end |