Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-02-16 12:48:37 +0300
committerRémy Coutable <remy@rymai.me>2016-02-16 12:50:24 +0300
commit5cd20de7499840463eb1ee91793359ea52f29af8 (patch)
treec0006e6bb773cf9c8f3f93d0fd8be1c57acead01 /app/views
parent3de6edd6041a725aaffba95603d4eb2912627d42 (diff)
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.
Diffstat (limited to 'app/views')
-rw-r--r--app/views/projects/diffs/_image.html.haml2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/views/projects/diffs/_image.html.haml b/app/views/projects/diffs/_image.html.haml
index 058b71b21f5..4fcf7ea0b26 100644
--- a/app/views/projects/diffs/_image.html.haml
+++ b/app/views/projects/diffs/_image.html.haml
@@ -1,4 +1,5 @@
- diff = diff_file.diff
+- file.load_all_data!(@project.repository)
- if diff.renamed_file || diff.new_file || diff.deleted_file
.image
%span.wrap
@@ -6,6 +7,7 @@
%img{src: "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
%p.image-info= "#{number_to_human_size file.size}"
- else
+ - old_file.load_all_data!(@project.repository)
.image
%div.two-up.view
%span.wrap