summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGabriel Gizotti <gabriel@gizotti.com>2016-11-25 07:01:05 +1000
committerGabriel Gizotti <gabriel@gizotti.com>2016-12-16 19:13:17 +1000
commitb4764a8dd22c29b7edc3065af9a99713aa5708d3 (patch)
tree5a7f2e8aae7896b444256100a744155f3ca3b556 /app
parent0e76daf3da35920d10053dc4d8707e1b6aa7c913 (diff)
downloadgitlab-ce-b4764a8dd22c29b7edc3065af9a99713aa5708d3.tar.gz
shorter lines on MergeRequest#merge_commit_message
Diffstat (limited to 'app')
-rw-r--r--app/models/merge_request.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb
index b8c139d01e2..5a5b8bd6010 100644
--- a/app/models/merge_request.rb
+++ b/app/models/merge_request.rb
@@ -631,10 +631,17 @@ class MergeRequest < ActiveRecord::Base
end
def merge_commit_message
+ closes_issues_references = closes_issues.map do |issue|
+ issue.to_reference(target_project)
+ end
+
message = "Merge branch '#{source_branch}' into '#{target_branch}'\n\n"
message << "#{title}\n\n"
- mr_closes_issues = closes_issues
- message << "Closed Issues: #{mr_closes_issues.map { |issue| issue.to_reference(target_project) }.join(", ")}\n\n" if mr_closes_issues.present?
+
+ if closes_issues_references.present?
+ message << "Closed Issues: #{closes_issues_references.join(", ")}\n\n"
+ end
+
message << "See merge request #{to_reference}"
message