Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
00716350
Commit
00716350
authored
Aug 02, 2018
by
Franz Liedke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
REFACTOR: Clarify assignment fallback chain
parent
72c0c534
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
app/services/merge_requests/build_service.rb
app/services/merge_requests/build_service.rb
+4
-6
No files found.
app/services/merge_requests/build_service.rb
View file @
00716350
...
...
@@ -128,8 +128,7 @@ module MergeRequests
#
def
assign_title_and_description
assign_title_and_description_from_single_commit
assign_title_from_issue
if
target_project
.
issues_enabled?
||
target_project
.
external_issue_tracker
merge_request
.
title
||=
title_from_issue
if
target_project
.
issues_enabled?
||
target_project
.
external_issue_tracker
merge_request
.
title
||=
source_branch
.
titleize
.
humanize
merge_request
.
title
=
wip_title
if
compare_commits
.
empty?
...
...
@@ -159,19 +158,18 @@ module MergeRequests
merge_request
.
description
||=
commit
.
description
.
try
(
:strip
)
end
def
assign_
title_from_issue
def
title_from_issue
return
unless
issue
merge_request
.
title
||=
"Resolve
\"
#{
issue
.
title
}
\"
"
if
issue
.
is_a?
(
Issue
)
return
"Resolve
\"
#{
issue
.
title
}
\"
"
if
issue
.
is_a?
(
Issue
)
return
if
merge_request
.
title
.
present?
return
if
issue_iid
.
blank?
title_parts
=
[
"Resolve
#{
issue
.
to_reference
}
"
]
branch_title
=
source_branch
.
downcase
.
remove
(
issue_iid
.
downcase
).
titleize
.
humanize
title_parts
<<
"
\"
#{
branch_title
}
\"
"
if
branch_title
.
present?
merge_request
.
title
=
title_parts
.
join
(
' '
)
title_parts
.
join
(
' '
)
end
def
issue_iid
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment