diff options
author | Sean McGivern <sean@gitlab.com> | 2018-02-14 14:51:49 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2018-02-14 17:58:28 +0300 |
commit | a4bb0ff8b899bf2e48b54d797997437431eaa802 (patch) | |
tree | 3de5865aaf79679e8a163884240a58fa023338e1 /app/services/merge_requests | |
parent | 5e829934f95bcae25f5c09583b6febe6e2e646b6 (diff) |
Fix closing issues text added to MRs for external issue trackers
Before, this would:
1. Not use the correct reference for non-JIRA external trackers.
2. Append 'Closes ' if an external tracker was enabled, but no issue matched the
branch name.
Diffstat (limited to 'app/services/merge_requests')
-rw-r--r-- | app/services/merge_requests/build_service.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/services/merge_requests/build_service.rb b/app/services/merge_requests/build_service.rb index ab6f8ea44a9..4b186d93772 100644 --- a/app/services/merge_requests/build_service.rb +++ b/app/services/merge_requests/build_service.rb @@ -134,7 +134,7 @@ module MergeRequests end def append_closes_description - return unless issue + return unless issue&.to_reference.present? closes_issue = "Closes #{issue.to_reference}" @@ -163,7 +163,7 @@ module MergeRequests return if merge_request.title.present? if issue_iid.present? - merge_request.title = "Resolve #{issue_iid}" + merge_request.title = "Resolve #{issue.to_reference}" branch_title = source_branch.downcase.remove(issue_iid.downcase).titleize.humanize merge_request.title += " \"#{branch_title}\"" if branch_title.present? end |