summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-02-16 11:48:52 +0000
committerDouwe Maan <douwe@gitlab.com>2016-02-16 11:48:52 +0000
commit21fa421ca3fae67eb16b3396ea0aad222dce1f54 (patch)
treece7ce5c58182b7955861bc94463b00158ddfb5fd
parent42d088fcb1e59a5789908dce8b141271bed3940a (diff)
parent5cd20de7499840463eb1ee91793359ea52f29af8 (diff)
downloadgitlab-ce-21fa421ca3fae67eb16b3396ea0aad222dce1f54.tar.gz
Merge branch 'fix/13458-eager-load-blob-data' into 'master'
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. /cc @jacobvosmaer @dblessing @rspeicher ### New image in commit view #### Before ![Screen_Shot_2016-02-16_at_11.28.18](/uploads/01c2afa2d25f3249b27744154ab2069b/Screen_Shot_2016-02-16_at_11.28.18.png) #### After ![Screen_Shot_2016-02-16_at_11.30.56](/uploads/5ef72f717f22dfd0c1efa9e6d8ed926f/Screen_Shot_2016-02-16_at_11.30.56.png) ### Replaced image in commit view #### Before ![Screen_Shot_2016-02-16_at_11.28.20](/uploads/39bb61851608643a86d9d7616139fc6c/Screen_Shot_2016-02-16_at_11.28.20.png) #### After ![Screen_Shot_2016-02-16_at_11.30.59](/uploads/27e754fe8b57a838ac695bace27618c3/Screen_Shot_2016-02-16_at_11.30.59.png) ### Deleted image in commit view #### Before ![Screen_Shot_2016-02-16_at_11.28.22](/uploads/3648dcc2c36bc644556080e203a29fca/Screen_Shot_2016-02-16_at_11.28.22.png) #### After ![Screen_Shot_2016-02-16_at_11.31.01](/uploads/2585915d994bb6e245dd8c8553730bbf/Screen_Shot_2016-02-16_at_11.31.01.png) ### Image diff in merge request diff view #### Before ![Screen_Shot_2016-02-16_at_11.28.37](/uploads/a7963f7139fc91975ca40568570ce4f0/Screen_Shot_2016-02-16_at_11.28.37.png) #### After ![Screen_Shot_2016-02-16_at_11.31.04](/uploads/6773dbf3b870f082f0262febc9722d20/Screen_Shot_2016-02-16_at_11.31.04.png) See merge request !2830
-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