gitlab-org--gitlab-foss/app/views/notify/push_to_merge_request_email.html.haml
Stan Hu 47b1528abe Fix undefined method one? when pushing to an existing merge request
An untested code path was triggering an Exception because Fixnum
doesn't have `one?` implemented in Rails, while arrays and collections
do.

Closes #45152
2018-04-07 23:43:40 -07:00

26 lines
1.1 KiB
Text

%h3
= @updated_by_user.name
pushed new commits to merge request
= link_to(@merge_request.to_reference, project_merge_request_url(@merge_request.target_project, @merge_request))
- if @existing_commits.any?
- count = @existing_commits.size
%ul
%li
- if count == 1
- commit_id = @existing_commits.first[:short_id]
= link_to(commit_id, project_commit_url(@merge_request.target_project, commit_id))
- else
= link_to(project_compare_url(@merge_request.target_project, from: @existing_commits.first[:short_id], to: @existing_commits.last[:short_id])) do
#{@existing_commits.first[:short_id]}...#{@existing_commits.last[:short_id]}
= precede ' - ' do
- commits_text = "#{count} commit".pluralize(count)
#{commits_text} from branch `#{@merge_request.target_branch}`
- if @new_commits.any?
%ul
- @new_commits.each do |commit|
%li
= link_to(commit[:short_id], project_commit_url(@merge_request.target_project, commit[:short_id]))
= precede ' - ' do
#{commit[:title]}