summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2018-03-27 14:31:54 +0000
committerNick Thomas <nick@gitlab.com>2018-03-27 14:31:54 +0000
commit96b355dca025ed2d85784bd73a9ff9d838181a3f (patch)
tree1d6da87c606e498d2733a57aedfed00767abc655 /lib/api
parentfbb727db3e72619044c23cf898b72a4dc85d3af2 (diff)
parent48717b434d583a0be1f22803edd6948c13e11591 (diff)
downloadgitlab-ce-96b355dca025ed2d85784bd73a9ff9d838181a3f.tar.gz
Merge branch 'jej/add-protected-branch-policy' into 'master'
Add protected branch policy See merge request gitlab-org/gitlab-ce!17982
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/protected_branches.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/api/protected_branches.rb b/lib/api/protected_branches.rb
index 33321db46e9..aa7cab4a741 100644
--- a/lib/api/protected_branches.rb
+++ b/lib/api/protected_branches.rb
@@ -70,7 +70,10 @@ module API
delete ':id/protected_branches/:name', requirements: BRANCH_ENDPOINT_REQUIREMENTS do
protected_branch = user_project.protected_branches.find_by!(name: params[:name])
- destroy_conditionally!(protected_branch)
+ destroy_conditionally!(protected_branch) do
+ destroy_service = ::ProtectedBranches::DestroyService.new(user_project, current_user)
+ destroy_service.execute(protected_branch)
+ end
end
end
end