Merge branch '36262_merge_request_reference_in_merge_commit_global' into 'master'

fix Merge request reference in merge commit is not global

Closes #36262

See merge request !13518
This commit is contained in:
Sean McGivern 2017-08-24 09:09:45 +00:00
commit 7ab4efa8f8
4 changed files with 9 additions and 5 deletions

View file

@ -683,9 +683,8 @@ class MergeRequest < ActiveRecord::Base
if !include_description && closes_issues_references.present?
message << "Closes #{closes_issues_references.to_sentence}"
end
message << "#{description}" if include_description && description.present?
message << "See merge request #{to_reference}"
message << "See merge request #{to_reference(full: true)}"
message.join("\n\n")
end

View file

@ -0,0 +1,5 @@
---
title: Merge request reference in merge commit changed to full reference
merge_request: 13518
author: haseebeqx
type: fixed

View file

@ -19,7 +19,7 @@ feature 'Clicking toggle commit message link', js: true do
"Merge branch 'feature' into 'master'",
merge_request.title,
"Closes #{issue_1.to_reference} and #{issue_2.to_reference}",
"See merge request #{merge_request.to_reference}"
"See merge request #{merge_request.to_reference(full: true)}"
].join("\n\n")
end
let(:message_with_description) do
@ -27,7 +27,7 @@ feature 'Clicking toggle commit message link', js: true do
"Merge branch 'feature' into 'master'",
merge_request.title,
merge_request.description,
"See merge request #{merge_request.to_reference}"
"See merge request #{merge_request.to_reference(full: true)}"
].join("\n\n")
end

View file

@ -604,7 +604,7 @@ describe MergeRequest do
request = build_stubbed(:merge_request)
expect(request.merge_commit_message)
.to match("See merge request #{request.to_reference}")
.to match("See merge request #{request.to_reference(full: true)}")
end
it 'excludes multiple linebreak runs when description is blank' do