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
def define_pipelines_vars
@pipelines = @merge_request.all_pipelines
if @pipelines.present? && @merge_request.commits.present?
@pipeline = @pipelines.first
@statuses = @pipeline.statuses.relevant
end
@pipeline = @merge_request.pipeline
@statuses = @pipeline.statuses.relevant if @pipeline.present?
end
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