Skip to content
代码片段 群组 项目
提交 f31f101d 编辑于 作者: Sid Sijbrandij's avatar Sid Sijbrandij
浏览文件

Merge pull request #6831 from pkill/better-email-on-push-subject

Provide better email subject lines from email on push service
No related branches found
No related tags found
无相关合并请求
...@@ -37,6 +37,7 @@ v 7.0.0 ...@@ -37,6 +37,7 @@ v 7.0.0
- Remove wall feature (no data loss - you can take it from database) - Remove wall feature (no data loss - you can take it from database)
- Dont expose user emails via API unless you are admin - Dont expose user emails via API unless you are admin
- Detect issues closed by Merge Request description - Detect issues closed by Merge Request description
- Better email subject lines from email on push service (Alex Elman)
v 6.9.2 v 6.9.2
- Revert the commit that broke the LDAP user filter - Revert the commit that broke the LDAP user filter
......
...@@ -25,13 +25,15 @@ def repository_push_email(project_id, recipient, author_id, branch, compare) ...@@ -25,13 +25,15 @@ def repository_push_email(project_id, recipient, author_id, branch, compare)
@branch = branch @branch = branch
if @commits.length > 1 if @commits.length > 1
@target_url = project_compare_url(@project, from: @commits.first, to: @commits.last) @target_url = project_compare_url(@project, from: @commits.first, to: @commits.last)
@subject = "#{@commits.length} new commits pushed to repository"
else else
@target_url = project_commit_url(@project, @commits.first) @target_url = project_commit_url(@project, @commits.first)
@subject = @commits.first.title
end end
mail(from: sender(author_id), mail(from: sender(author_id),
cc: recipient, cc: recipient,
subject: subject("New push to repository")) subject: subject(@subject))
end end
end end
end end
...@@ -537,7 +537,7 @@ ...@@ -537,7 +537,7 @@
end end
it 'has the correct subject' do it 'has the correct subject' do
should have_subject /New push to repository/ should have_subject /#{commits.length} new commits pushed to repository/
end end
it 'includes commits list' do it 'includes commits list' do
...@@ -573,7 +573,7 @@ ...@@ -573,7 +573,7 @@
end end
it 'has the correct subject' do it 'has the correct subject' do
should have_subject /New push to repository/ should have_subject /#{commits.first.title}/
end end
it 'includes commits list' do it 'includes commits list' do
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册