summaryrefslogtreecommitdiff
path: root/lib/api/protected_branches.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/protected_branches.rb')
-rw-r--r--lib/api/protected_branches.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/api/protected_branches.rb b/lib/api/protected_branches.rb
index dccf4fa27a7..15fcb9e8e27 100644
--- a/lib/api/protected_branches.rb
+++ b/lib/api/protected_branches.rb
@@ -76,9 +76,7 @@ module API
delete ':id/protected_branches/:name', requirements: BRANCH_ENDPOINT_REQUIREMENTS do
protected_branch = user_project.protected_branches.find_by!(name: params[:name])
- protected_branch.destroy
-
- status 204
+ destroy_conditionally!(protected_branch)
end
end
end