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
72c0c534
Commit
72c0c534
authored
Aug 02, 2018
by
Franz Liedke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
REFACTOR: Use early return to flatten code
parent
50f9e926
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
app/services/merge_requests/build_service.rb
app/services/merge_requests/build_service.rb
+5
-6
No files found.
app/services/merge_requests/build_service.rb
View file @
72c0c534
...
@@ -165,14 +165,13 @@ module MergeRequests
...
@@ -165,14 +165,13 @@ module MergeRequests
merge_request
.
title
||=
"Resolve
\"
#{
issue
.
title
}
\"
"
if
issue
.
is_a?
(
Issue
)
merge_request
.
title
||=
"Resolve
\"
#{
issue
.
title
}
\"
"
if
issue
.
is_a?
(
Issue
)
return
if
merge_request
.
title
.
present?
return
if
merge_request
.
title
.
present?
return
if
issue_iid
.
blank?
if
issue_iid
.
present?
title_parts
=
[
"Resolve
#{
issue
.
to_reference
}
"
]
title_parts
=
[
"Resolve
#{
issue
.
to_reference
}
"
]
branch_title
=
source_branch
.
downcase
.
remove
(
issue_iid
.
downcase
).
titleize
.
humanize
branch_title
=
source_branch
.
downcase
.
remove
(
issue_iid
.
downcase
).
titleize
.
humanize
title_parts
<<
"
\"
#{
branch_title
}
\"
"
if
branch_title
.
present?
title_parts
<<
"
\"
#{
branch_title
}
\"
"
if
branch_title
.
present?
merge_request
.
title
=
title_parts
.
join
(
' '
)
merge_request
.
title
=
title_parts
.
join
(
' '
)
end
end
end
def
issue_iid
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