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
This commit is contained in:
commit
b180476bd6
1 changed files with 7 additions and 6 deletions
|
@ -50,12 +50,13 @@ module MergeRequests
|
|||
end
|
||||
|
||||
commits = merge_request.compare_commits
|
||||
merge_request.title = \
|
||||
if commits && commits.count == 1
|
||||
commits.first.title
|
||||
else
|
||||
merge_request.source_branch.titleize.humanize
|
||||
end
|
||||
if commits && commits.count == 1
|
||||
commit = commits.first
|
||||
merge_request.title = commit.title
|
||||
merge_request.description = commit.description.try(:strip)
|
||||
else
|
||||
merge_request.title = merge_request.source_branch.titleize.humanize
|
||||
end
|
||||
|
||||
merge_request
|
||||
|
||||
|
|
Loading…
Reference in a new issue