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

Improve MergeRequest#head_pipeline

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