Commit 48a0e9f6 authored by Douwe Maan's avatar Douwe Maan

Fix specs

parent 1817f877
...@@ -61,7 +61,6 @@ class Projects::CompareController < Projects::ApplicationController ...@@ -61,7 +61,6 @@ class Projects::CompareController < Projects::ApplicationController
@environment = EnvironmentsFinder.new(@project, current_user, environment_params).execute.last @environment = EnvironmentsFinder.new(@project, current_user, environment_params).execute.last
@diff_notes_disabled = true @diff_notes_disabled = true
@grouped_diff_discussions = {}
end end
end end
......
...@@ -122,7 +122,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController ...@@ -122,7 +122,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController
build_merge_request build_merge_request
@diffs = @merge_request.diffs(diff_options) @diffs = @merge_request.diffs(diff_options)
@diff_notes_disabled = true @diff_notes_disabled = true
@grouped_diff_discussions = {}
end end
define_commit_vars define_commit_vars
...@@ -576,10 +575,13 @@ class Projects::MergeRequestsController < Projects::ApplicationController ...@@ -576,10 +575,13 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@comparable_diffs = @merge_request_diffs.select { |diff| diff.id < @merge_request_diff.id } @comparable_diffs = @merge_request_diffs.select { |diff| diff.id < @merge_request_diff.id }
if params[:start_sha].present? if params[:start_sha].present?
start_sha = params[:start_sha] @start_sha = params[:start_sha]
@start_version = @comparable_diffs.find { |diff| diff.head_commit_sha == start_sha } @start_version = @comparable_diffs.find { |diff| diff.head_commit_sha == @start_sha }
@start_sha = start_sha if @start_version unless @start_version
@start_sha = @merge_request_diff.head_commit_sha
@start_version = @merge_request_diff
end
end end
@diffs = @diffs =
......
...@@ -62,6 +62,8 @@ module DiffHelper ...@@ -62,6 +62,8 @@ module DiffHelper
end end
def parallel_diff_discussions(left, right, diff_file) def parallel_diff_discussions(left, right, diff_file)
return unless @grouped_diff_discussions
discussions_left = discussions_right = nil discussions_left = discussions_right = nil
if left && (left.unchanged? || left.removed?) if left && (left.unchanged? || left.removed?)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment