summaryrefslogtreecommitdiff
path: root/lib/api/branches.rb
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2018-09-13 14:53:05 +0000
committerRobert Speicher <robert@gitlab.com>2018-09-13 14:53:05 +0000
commitc7d1eef671dbf598814a6c2ff1f81b924583ae8a (patch)
tree23988df1d29e933943858a66821ba7f493976b3e /lib/api/branches.rb
parentff5d8b635f234241441009e41af7b61f5804b2c2 (diff)
parent2039c8280db1646845c33d6c5a74e5f23ca6f4de (diff)
downloadgitlab-ce-c7d1eef671dbf598814a6c2ff1f81b924583ae8a.tar.gz
Merge branch 'rubocop-code-reuse' into 'master'
Add RuboCop cops to enforce code reusing rules See merge request gitlab-org/gitlab-ce!21391
Diffstat (limited to 'lib/api/branches.rb')
-rw-r--r--lib/api/branches.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/api/branches.rb b/lib/api/branches.rb
index ac33c2924ca..5d106ed93a0 100644
--- a/lib/api/branches.rb
+++ b/lib/api/branches.rb
@@ -73,6 +73,7 @@ module API
optional :developers_can_push, type: Boolean, desc: 'Flag if developers can push to that branch'
optional :developers_can_merge, type: Boolean, desc: 'Flag if developers can merge to that branch'
end
+ # rubocop: disable CodeReuse/ActiveRecord
put ':id/repository/branches/:branch/protect', requirements: BRANCH_ENDPOINT_REQUIREMENTS do
authorize_admin_project
@@ -100,6 +101,7 @@ module API
render_api_error!(protected_branch.errors.full_messages, 422)
end
end
+ # rubocop: enable CodeReuse/ActiveRecord
# Note: This API will be deprecated in favor of the protected branches API.
desc 'Unprotect a single branch' do
@@ -108,6 +110,7 @@ module API
params do
requires :branch, type: String, desc: 'The name of the branch', allow_blank: false
end
+ # rubocop: disable CodeReuse/ActiveRecord
put ':id/repository/branches/:branch/unprotect', requirements: BRANCH_ENDPOINT_REQUIREMENTS do
authorize_admin_project
@@ -117,6 +120,7 @@ module API
present branch, with: Entities::Branch, current_user: current_user, project: user_project
end
+ # rubocop: enable CodeReuse/ActiveRecord
desc 'Create branch' do
success Entities::Branch