summaryrefslogtreecommitdiff
path: root/app/mailers
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-17 12:09:20 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-17 12:09:20 +0000
commitb84eeb256c4a780d902faee1f99ca9a711b3214a (patch)
tree32918aadbea9210eace50efbce9afbfb8cd3ba84 /app/mailers
parent53ae6b7e3f83591ad251a3f771f5bf3b8cf087ba (diff)
downloadgitlab-ce-b84eeb256c4a780d902faee1f99ca9a711b3214a.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/mailers')
-rw-r--r--app/mailers/emails/pipelines.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/mailers/emails/pipelines.rb b/app/mailers/emails/pipelines.rb
index 95bb52d8f97..773b9fead3a 100644
--- a/app/mailers/emails/pipelines.rb
+++ b/app/mailers/emails/pipelines.rb
@@ -15,7 +15,13 @@ module Emails
def pipeline_mail(pipeline, recipients, status)
@project = pipeline.project
@pipeline = pipeline
- @merge_request = pipeline.all_merge_requests.first
+
+ @merge_request = if pipeline.merge_request?
+ pipeline.merge_request
+ else
+ pipeline.merge_requests_as_head_pipeline.first
+ end
+
add_headers
# We use bcc here because we don't want to generate these emails for a