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
Boxiang Sun
gitlab-ce
Commits
a47565aa
Commit
a47565aa
authored
Mar 26, 2018
by
James Edwards-Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated grape to `1.0.2` to remove workaround
parent
391732a2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
8 deletions
+3
-8
Gemfile.lock
Gemfile.lock
+2
-2
lib/api/protected_branches.rb
lib/api/protected_branches.rb
+1
-6
No files found.
Gemfile.lock
View file @
a47565aa
...
@@ -357,7 +357,7 @@ GEM
...
@@ -357,7 +357,7 @@ GEM
signet (~> 0.7)
signet (~> 0.7)
gpgme (2.0.13)
gpgme (2.0.13)
mini_portile2 (~> 2.1)
mini_portile2 (~> 2.1)
grape (1.0.
0
)
grape (1.0.
2
)
activesupport
activesupport
builder
builder
mustermann-grape (~> 1.0.0)
mustermann-grape (~> 1.0.0)
...
@@ -507,7 +507,7 @@ GEM
...
@@ -507,7 +507,7 @@ GEM
multi_json (1.13.1)
multi_json (1.13.1)
multi_xml (0.6.0)
multi_xml (0.6.0)
multipart-post (2.0.0)
multipart-post (2.0.0)
mustermann (1.0.
0
)
mustermann (1.0.
2
)
mustermann-grape (1.0.0)
mustermann-grape (1.0.0)
mustermann (~> 1.0.0)
mustermann (~> 1.0.0)
mysql2 (0.4.10)
mysql2 (0.4.10)
...
...
lib/api/protected_branches.rb
View file @
a47565aa
...
@@ -52,12 +52,7 @@ module API
...
@@ -52,12 +52,7 @@ module API
conflict!
(
"Protected branch '
#{
params
[
:name
]
}
' already exists"
)
conflict!
(
"Protected branch '
#{
params
[
:name
]
}
' already exists"
)
end
end
# Replace with `declared(params)` after updating to grape v1.0.2
api_service
=
::
ProtectedBranches
::
ApiService
.
new
(
user_project
,
current_user
,
declared
(
params
))
# See https://github.com/ruby-grape/grape/pull/1710
# and https://gitlab.com/gitlab-org/gitlab-ce/issues/40843
declared_params
=
params
.
slice
(
"name"
,
"push_access_level"
,
"merge_access_level"
,
"allowed_to_push"
,
"allowed_to_merge"
)
api_service
=
::
ProtectedBranches
::
ApiService
.
new
(
user_project
,
current_user
,
declared_params
)
protected_branch
=
api_service
.
create
protected_branch
=
api_service
.
create
if
protected_branch
.
persisted?
if
protected_branch
.
persisted?
...
...
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