diff options
author | Paco Guzman <pacoguzmanp@gmail.com> | 2016-07-20 18:25:36 +0200 |
---|---|---|
committer | Paco Guzman <pacoguzmanp@gmail.com> | 2016-08-03 07:00:19 +0200 |
commit | cd7c2cb6ddd4d9c9f9bdae00c887c0022c121c17 (patch) | |
tree | fad9386721cc514f28a011ef734b8791fc1c13be /app/controllers/projects/compare_controller.rb | |
parent | 195b20e1b9ff08437c5a436dc14f04e7f1bee807 (diff) | |
download | gitlab-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.rb | 6 |
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 = {} |