Commit db966364 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

MergeRequest#automerge accepts custom message now....

MergeRequest#automerge accepts custom message now. MergeRequest#merge_commit_message generate default one
Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent d84b0fa6
......@@ -214,8 +214,8 @@ class MergeRequest < ActiveRecord::Base
self.merge
end
def automerge!(current_user)
if Gitlab::Satellite::MergeAction.new(current_user, self).merge! && self.unmerged_commits.empty?
def automerge!(current_user, merge_commit_message = nil)
if Gitlab::Satellite::MergeAction.new(current_user, self).merge!(merge_commit_message) && self.unmerged_commits.empty?
self.merge!(current_user.id)
true
end
......@@ -319,6 +319,14 @@ class MergeRequest < ActiveRecord::Base
update_all(updated_at: Time.now)
end
def merge_commit_message
message = "Merge branch '#{source_branch}' into '#{target_branch}'"
message << "\n\n"
message << title
message << "\n\n"
message << description
end
private
def dump_commits(commits)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment