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
fceffe4d
Commit
fceffe4d
authored
Nov 22, 2017
by
James Edwards-Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed ProtectedBranches::ApiUpdateService to LegacyApiUpdateService
parent
e548c613
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
app/services/protected_branches/legacy_api_create_service.rb
app/services/protected_branches/legacy_api_create_service.rb
+2
-2
app/services/protected_branches/legacy_api_update_service.rb
app/services/protected_branches/legacy_api_update_service.rb
+2
-2
lib/api/branches.rb
lib/api/branches.rb
+2
-2
No files found.
app/services/protected_branches/api_create_service.rb
→
app/services/protected_branches/
legacy_
api_create_service.rb
View file @
fceffe4d
# The
protected branches
API still uses the `developers_can_push` and `developers_can_merge`
# The
branches#protect
API still uses the `developers_can_push` and `developers_can_merge`
# flags for backward compatibility, and so performs translation between that format and the
# flags for backward compatibility, and so performs translation between that format and the
# internal data model (separate access levels). The translation code is non-trivial, and so
# internal data model (separate access levels). The translation code is non-trivial, and so
# lives in this service.
# lives in this service.
module
ProtectedBranches
module
ProtectedBranches
class
ApiCreateService
<
BaseService
class
Legacy
ApiCreateService
<
BaseService
def
execute
def
execute
push_access_level
=
push_access_level
=
if
params
.
delete
(
:developers_can_push
)
if
params
.
delete
(
:developers_can_push
)
...
...
app/services/protected_branches/api_update_service.rb
→
app/services/protected_branches/
legacy_
api_update_service.rb
View file @
fceffe4d
# The
protected branches
API still uses the `developers_can_push` and `developers_can_merge`
# The
branches#protect
API still uses the `developers_can_push` and `developers_can_merge`
# flags for backward compatibility, and so performs translation between that format and the
# flags for backward compatibility, and so performs translation between that format and the
# internal data model (separate access levels). The translation code is non-trivial, and so
# internal data model (separate access levels). The translation code is non-trivial, and so
# lives in this service.
# lives in this service.
module
ProtectedBranches
module
ProtectedBranches
class
ApiUpdateService
<
BaseService
class
Legacy
ApiUpdateService
<
BaseService
def
execute
(
protected_branch
)
def
execute
(
protected_branch
)
@developers_can_push
=
params
.
delete
(
:developers_can_push
)
@developers_can_push
=
params
.
delete
(
:developers_can_push
)
@developers_can_merge
=
params
.
delete
(
:developers_can_merge
)
@developers_can_merge
=
params
.
delete
(
:developers_can_merge
)
...
...
lib/api/branches.rb
View file @
fceffe4d
...
@@ -81,9 +81,9 @@ module API
...
@@ -81,9 +81,9 @@ module API
service_args
=
[
user_project
,
current_user
,
protected_branch_params
]
service_args
=
[
user_project
,
current_user
,
protected_branch_params
]
protected_branch
=
if
protected_branch
protected_branch
=
if
protected_branch
::
ProtectedBranches
::
ApiUpdateService
.
new
(
*
service_args
).
execute
(
protected_branch
)
::
ProtectedBranches
::
Legacy
ApiUpdateService
.
new
(
*
service_args
).
execute
(
protected_branch
)
else
else
::
ProtectedBranches
::
ApiCreateService
.
new
(
*
service_args
).
execute
::
ProtectedBranches
::
Legacy
ApiCreateService
.
new
(
*
service_args
).
execute
end
end
if
protected_branch
.
valid?
if
protected_branch
.
valid?
...
...
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