Commit 5cd20de7 authored by Rémy Coutable's avatar Rémy Coutable

Eager-load image blob data in diffs

Since gitlab_git 8.0, blob data are lazy-loaded so we have to call
blob.load_all_data!(repo) to eager-load them.

Fixes #13458.
parent 3de6edd6
- diff = diff_file.diff - diff = diff_file.diff
- file.load_all_data!(@project.repository)
- if diff.renamed_file || diff.new_file || diff.deleted_file - if diff.renamed_file || diff.new_file || diff.deleted_file
.image .image
%span.wrap %span.wrap
...@@ -6,6 +7,7 @@ ...@@ -6,6 +7,7 @@
%img{src: "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} %img{src: "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
%p.image-info= "#{number_to_human_size file.size}" %p.image-info= "#{number_to_human_size file.size}"
- else - else
- old_file.load_all_data!(@project.repository)
.image .image
%div.two-up.view %div.two-up.view
%span.wrap %span.wrap
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment