Commit 8f78ba55 authored by Felipe Artur's avatar Felipe Artur

Improve MergeRequest#head_pipeline

parent fe673b49
......@@ -146,11 +146,7 @@ class MergeRequest < ActiveRecord::Base
end
def head_pipeline
return unless head_pipeline_id
last_pipeline = Ci::Pipeline.find(head_pipeline_id)
last_pipeline.sha == diff_head_sha ? last_pipeline : nil
super&.sha == diff_head_sha ? super : nil
end
# Pattern used to extract `!123` merge request references from text
......
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