Read about our upcoming Code of Conduct on this issue

Commit 09209725 authored by Sean McGivern's avatar Sean McGivern
Browse files

Don't auto-set MR title for confidential issues

parent 40275318e6c6
......@@ -68,7 +68,7 @@ def set_title_and_description(merge_request)
commit = commits.first
merge_request.title = commit.title
merge_request.description ||= commit.description.try(:strip)
elsif iid && (issue = merge_request.target_project.get_issue(iid))
elsif iid && (issue = merge_request.target_project.get_issue(iid)) && !issue.try(:confidential?)
case issue
when Issue
merge_request.title = "Resolve \"#{issue.title}\""
......
......@@ -5,7 +5,8 @@
let(:project) { create(:project) }
let(:user) { create(:user) }
let(:issue) { create(:issue, project: project, title: 'A bug') }
let(:issue_confidential) { false }
let(:issue) { create(:issue, project: project, title: 'A bug', confidential: issue_confidential) }
let(:description) { nil }
let(:source_branch) { 'feature-branch' }
let(:target_branch) { 'master' }
......@@ -156,6 +157,14 @@
expect(merge_request.title).to eq("#{issue.iid.succ} fix issue")
end
end
context 'issue is confidential' do
let(:issue_confidential) { true }
it 'uses the title of the branch as the merge request title' do
expect(merge_request.title).to eq("#{issue.iid} fix issue")
end
end
end
context 'branch starts with external issue IID followed by a hyphen' do
......
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