diff options
author | James Edwards-Jones <jedwardsjones@gitlab.com> | 2018-03-25 02:29:13 +0100 |
---|---|---|
committer | James Edwards-Jones <jedwardsjones@gitlab.com> | 2018-03-26 10:29:53 +0100 |
commit | b6a4c0181b2a3d8bebde549cb9ad8dc6da8361d6 (patch) | |
tree | 4e17077873e589555abfc7381341791db2ffa8e0 /lib | |
parent | 973bd4622dec2c326d05a047b93a7b67c9196fb4 (diff) | |
download | gitlab-ce-b6a4c0181b2a3d8bebde549cb9ad8dc6da8361d6.tar.gz |
API uses ProtectedBranchPolicy for destroy/create
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/protected_branches.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/api/protected_branches.rb b/lib/api/protected_branches.rb index c15c487deb4..b896cc93168 100644 --- a/lib/api/protected_branches.rb +++ b/lib/api/protected_branches.rb @@ -74,7 +74,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 |