summaryrefslogtreecommitdiff
path: root/app/mailers/emails
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-02-25 15:12:19 +0100
committerDouwe Maan <douwe@gitlab.com>2015-02-25 15:12:19 +0100
commit5d86332153838252384f9f87a0ae3e34c46eb266 (patch)
tree47de3c1f04c5b2302f6269d6284d68cd29158214 /app/mailers/emails
parent769f137a5344dbc3748c2fea7c1d560392410ca4 (diff)
downloadgitlab-ce-5d86332153838252384f9f87a0ae3e34c46eb266.tar.gz
Send EmailsOnPush when deleting commits using force push.
See #1924.
Diffstat (limited to 'app/mailers/emails')
-rw-r--r--app/mailers/emails/projects.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/mailers/emails/projects.rb b/app/mailers/emails/projects.rb
index 30959ab6a1e..5c38601c1ba 100644
--- a/app/mailers/emails/projects.rb
+++ b/app/mailers/emails/projects.rb
@@ -16,9 +16,10 @@ module Emails
subject: subject("Project was moved"))
end
- def repository_push_email(project_id, recipient, author_id, branch, compare, send_from_committer_email = false, disable_diffs = false)
+ def repository_push_email(project_id, recipient, author_id, branch, compare, reverse_compare = false, send_from_committer_email = false, disable_diffs = false)
@project = Project.find(project_id)
@author = User.find(author_id)
+ @reverse_compare = reverse_compare
@compare = compare
@commits = Commit.decorate(compare.commits)
@diffs = compare.diffs
@@ -32,10 +33,13 @@ module Emails
@project,
from: @commits.first,
to: @commits.last)
+ @subject << "Deleted " if @reverse_compare
@subject << "#{@commits.length} commits: #{@commits.first.title}"
else
@target_url = namespace_project_commit_url(@project.namespace,
@project, @commits.first)
+
+ @subject << "Deleted 1 commit: " if @reverse_compare
@subject << @commits.first.title
end