Commit b180476b authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'mr-body-single-commit' into 'master'

Base new MR description on commit description if there's only one.

Closes #2029, again.

See merge request !1561
parents 8ae3112b 2f76ccdf
...@@ -50,11 +50,12 @@ module MergeRequests ...@@ -50,11 +50,12 @@ module MergeRequests
end end
commits = merge_request.compare_commits commits = merge_request.compare_commits
merge_request.title = \
if commits && commits.count == 1 if commits && commits.count == 1
commits.first.title commit = commits.first
merge_request.title = commit.title
merge_request.description = commit.description.try(:strip)
else else
merge_request.source_branch.titleize.humanize merge_request.title = merge_request.source_branch.titleize.humanize
end end
merge_request merge_request
......
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