summaryrefslogtreecommitdiff
path: root/app/controllers/projects/compare_controller.rb
diff options
context:
space:
mode:
authorPaco Guzman <pacoguzmanp@gmail.com>2016-07-20 18:25:36 +0200
committerPaco Guzman <pacoguzmanp@gmail.com>2016-08-03 07:00:19 +0200
commitcd7c2cb6ddd4d9c9f9bdae00c887c0022c121c17 (patch)
treefad9386721cc514f28a011ef734b8791fc1c13be /app/controllers/projects/compare_controller.rb
parent195b20e1b9ff08437c5a436dc14f04e7f1bee807 (diff)
downloadgitlab-ce-cd7c2cb6ddd4d9c9f9bdae00c887c0022c121c17.tar.gz
Cache highlighted diff lines for merge requests
Introducing the concept of SafeDiffs which relates diffs with UI highlighting.
Diffstat (limited to 'app/controllers/projects/compare_controller.rb')
-rw-r--r--app/controllers/projects/compare_controller.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/projects/compare_controller.rb b/app/controllers/projects/compare_controller.rb
index 8c004724f02..2eda950a1bd 100644
--- a/app/controllers/projects/compare_controller.rb
+++ b/app/controllers/projects/compare_controller.rb
@@ -21,7 +21,7 @@ class Projects::CompareController < Projects::ApplicationController
def diff_for_path
return render_404 unless @compare
- render_diff_for_path(@diffs, @diff_refs, @project)
+ render_diff_for_path(SafeDiffs::Compare.new(@compare, project: @project, diff_options: diff_options))
end
def create
@@ -46,12 +46,12 @@ class Projects::CompareController < Projects::ApplicationController
@commit = @project.commit(@head_ref)
@base_commit = @project.merge_base_commit(@start_ref, @head_ref)
- @diffs = @compare.diffs(diff_options)
- @diff_refs = Gitlab::Diff::DiffRefs.new(
+ diff_refs = Gitlab::Diff::DiffRefs.new(
base_sha: @base_commit.try(:sha),
start_sha: @start_commit.try(:sha),
head_sha: @commit.try(:sha)
)
+ @diffs = SafeDiffs::Compare.new(@compare, project: @project, diff_options: diff_options, diff_refs: diff_refs)
@diff_notes_disabled = true
@grouped_diff_discussions = {}