Commit d7bd8f12 authored by Adam Niedzielski's avatar Adam Niedzielski

Do not use MergeRequest#commits in define_pipelines_vars

MergeRequest#commits requires merge_request_diff to be present.
This is not the case when creating a new merge request.
parent b1b5060d
...@@ -563,11 +563,8 @@ class Projects::MergeRequestsController < Projects::ApplicationController ...@@ -563,11 +563,8 @@ class Projects::MergeRequestsController < Projects::ApplicationController
def define_pipelines_vars def define_pipelines_vars
@pipelines = @merge_request.all_pipelines @pipelines = @merge_request.all_pipelines
@pipeline = @merge_request.pipeline
if @pipelines.present? && @merge_request.commits.present? @statuses = @pipeline.statuses.relevant if @pipeline.present?
@pipeline = @pipelines.first
@statuses = @pipeline.statuses.relevant
end
end end
def define_new_vars def define_new_vars
......
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