summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaco Guzman <pacoguzmanp@gmail.com>2016-08-03 15:11:33 +0200
committerPaco Guzman <pacoguzmanp@gmail.com>2016-08-04 15:38:13 +0200
commitaad9f065f8819538a278e2070975dadc0c336718 (patch)
treebb3ffb2b37e2c3f3111f9ed0de7c67f130fcbc0e
parentf4c79d6a84defb6ffae7d29a5c9a81fbc413f16c (diff)
downloadgitlab-ce-14202-dont-need-blobs.tar.gz
Don't load blob or content_commits on Gitlab::Diff::File instance for discussions14202-dont-need-blobs
-rw-r--r--CHANGELOG1
-rw-r--r--app/views/discussions/_diff_with_notes.html.haml6
-rw-r--r--app/views/projects/diffs/_content.html.haml2
-rw-r--r--app/views/projects/diffs/_file_header.html.haml2
4 files changed, 7 insertions, 4 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 886b7865e5b..79ff94c0c37 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -61,6 +61,7 @@ v 8.11.0 (unreleased)
- Add CI configuration button on project page
- Make error pages responsive (Takuya Noguchi)
- Fix skip_repo parameter being ignored when destroying a namespace
+ - Don't load blob or content_commits on Gitlab::Diff::File instance for discussions
- Change requests_profiles resource constraint to catch virtually any file
- Reduce number of queries made for merge_requests/:id/diffs
- Sensible state specific default sort order for issues and merge requests !5453 (tomb0y)
diff --git a/app/views/discussions/_diff_with_notes.html.haml b/app/views/discussions/_diff_with_notes.html.haml
index 02b159ffd45..227fce1dae3 100644
--- a/app/views/discussions/_diff_with_notes.html.haml
+++ b/app/views/discussions/_diff_with_notes.html.haml
@@ -1,9 +1,11 @@
- diff_file = discussion.diff_file
-- blob = discussion.blob
+- if diff_file.submodule?
+ - diff_commit = diff_file.content_commit
+ - blob = discussion.blob(diff_commit)
.diff-file.file-holder
.file-title
- = render "projects/diffs/file_header", diff_file: diff_file, blob: blob, diff_commit: diff_file.content_commit, project: discussion.project, url: discussion_diff_path(discussion)
+ = render "projects/diffs/file_header", diff_file: diff_file, blob: blob, diff_commit: diff_commit, project: discussion.project, url: discussion_diff_path(discussion)
.diff-content.code.js-syntax-highlight
%table
diff --git a/app/views/projects/diffs/_content.html.haml b/app/views/projects/diffs/_content.html.haml
index a1b071f130c..b0fb3067725 100644
--- a/app/views/projects/diffs/_content.html.haml
+++ b/app/views/projects/diffs/_content.html.haml
@@ -14,7 +14,7 @@
This diff is collapsed. Click to expand it.
- elsif diff_file.diff_lines.length > 0
- if diff_view == 'parallel'
- = render "projects/diffs/parallel_view", diff_file: diff_file, project: project, blob: blob
+ = render "projects/diffs/parallel_view", diff_file: diff_file
- else
= render "projects/diffs/text_file", diff_file: diff_file
- else
diff --git a/app/views/projects/diffs/_file_header.html.haml b/app/views/projects/diffs/_file_header.html.haml
index 95a2772fd0b..44fda24d50d 100644
--- a/app/views/projects/diffs/_file_header.html.haml
+++ b/app/views/projects/diffs/_file_header.html.haml
@@ -1,4 +1,4 @@
-- if defined?(blob) && blob && diff_file.submodule?
+- if diff_file.submodule? && blob && diff_commit
%span
= icon('archive fw')
%span