summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-09-27 12:55:04 +0000
committerRobert Speicher <robert@gitlab.com>2016-09-27 12:55:04 +0000
commit7b42ff6306bccc63a70f6731ce92974ec0a5e12b (patch)
treeb51aefb92ff675199177b0d279116affd75448be /app
parentb0af83f9ff78773dbcd5435841bdac514d6e242f (diff)
parentb007bd810175dac80a509fb0c066d854f044fb96 (diff)
downloadgitlab-ce-7b42ff6306bccc63a70f6731ce92974ec0a5e12b.tar.gz
Merge branch 'rs-merge_commit_message' into 'master' doc-setup-ssh
Improve how MergeCommit#merge_commit_message builds the message Now a merge request with a blank description will no longer produce a merge commit message like this: ``` Merge branch 'foo' into 'master' Bring the wonders of foo into the world See merge request !7283 ``` What an improvement! :tada: See merge request !6450
Diffstat (limited to 'app')
-rw-r--r--app/models/merge_request.rb12
1 files changed, 5 insertions, 7 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb
index 2dcf7f89bfc..aec555dcec0 100644
--- a/app/models/merge_request.rb
+++ b/app/models/merge_request.rb
@@ -590,13 +590,11 @@ class MergeRequest < ActiveRecord::Base
end
def merge_commit_message
- message = "Merge branch '#{source_branch}' into '#{target_branch}'"
- message << "\n\n"
- message << title.to_s
- message << "\n\n"
- message << description.to_s
- message << "\n\n"
- message << "See merge request !#{iid}"
+ message = "Merge branch '#{source_branch}' into '#{target_branch}'\n\n"
+ message << "#{title}\n\n"
+ message << "#{description}\n\n" if description.present?
+ message << "See merge request #{to_reference}"
+
message
end