diff options
author | Adam Niedzielski <adamsunday@gmail.com> | 2016-11-22 15:21:01 +0100 |
---|---|---|
committer | Adam Niedzielski <adamsunday@gmail.com> | 2016-11-22 15:21:01 +0100 |
commit | d7bd8f128e08da9f4aa9d395d430bb35e4a5e3eb (patch) | |
tree | d57b828d05f283d8f148aee73b59bfdc22fbf291 /app/controllers/projects | |
parent | b1b5060dbad15975184ec20a1914c7c48fc804db (diff) | |
download | gitlab-ce-d7bd8f128e08da9f4aa9d395d430bb35e4a5e3eb.tar.gz |
Do not use MergeRequest#commits in define_pipelines_varshot-fix-define-pipeline-vars
MergeRequest#commits requires merge_request_diff to be present.
This is not the case when creating a new merge request.
Diffstat (limited to 'app/controllers/projects')
-rw-r--r-- | app/controllers/projects/merge_requests_controller.rb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index dbbd2ad849e..e24a670631f 100644 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -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 |