diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-02-20 22:17:38 +0100 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-02-20 22:17:38 +0100 |
commit | 2f76ccdfac59f7bb6875e0a7753a390d4f6f2b38 (patch) | |
tree | b73c963293bee2fe69f51adbf9177ffccc58db5d /app | |
parent | 1f617c3c5ffd3b8b4d1eb29d9cda8a2e7a749133 (diff) | |
download | gitlab-ce-2f76ccdfac59f7bb6875e0a7753a390d4f6f2b38.tar.gz |
Base new MR description on commit description if there's only one.
Diffstat (limited to 'app')
-rw-r--r-- | app/services/merge_requests/build_service.rb | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/app/services/merge_requests/build_service.rb b/app/services/merge_requests/build_service.rb index 30e0cbae024..a44b91166e8 100644 --- a/app/services/merge_requests/build_service.rb +++ b/app/services/merge_requests/build_service.rb @@ -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 |