diff options
author | Toon Claes <toon@iotcl.com> | 2016-09-21 17:15:12 +0300 |
---|---|---|
committer | Toon Claes <toon@iotcl.com> | 2016-11-09 23:04:03 +0300 |
commit | 1afab9eb79c87f32c7b899e58bc9a0ea8a113594 (patch) | |
tree | 33068aabffdb6b76c0489246429a3a71c2b748a4 /lib/api/branches.rb | |
parent | c392b0cc24ba40e3fed920c6c693cb24665193af (diff) |
Add button to delete all merged branches
It adds a button to the branches page that the user can use to delete
all the branches that are already merged. This can be used to clean up
all the branches that were forgotten to delete while merging MRs.
Fixes #21076.
Diffstat (limited to 'lib/api/branches.rb')
-rw-r--r-- | lib/api/branches.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/api/branches.rb b/lib/api/branches.rb index 21a106387f0..73aed624ea7 100644 --- a/lib/api/branches.rb +++ b/lib/api/branches.rb @@ -128,6 +128,18 @@ module API render_api_error!(result[:message], result[:return_code]) end end + + # Delete all merged branches + # + # Parameters: + # id (required) - The ID of a project + # Example Request: + # DELETE /projects/:id/repository/branches/delete_merged + delete ":id/repository/merged_branches" do + DeleteMergedBranchesService.new(user_project, current_user).async_execute + + status(200) + end end end end |