summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-11-15 12:08:22 +0000
committerDouwe Maan <douwe@gitlab.com>2016-11-15 12:08:22 +0000
commit374b8e95c38833d6aeee491b077bd43c023c0686 (patch)
tree835d9ec86a4ff178b7a4891adbdb39a26ce9a5b6 /lib/api
parentfdd7e3f6e93e02adacf283071f88e3284449bb3a (diff)
parent1afab9eb79c87f32c7b899e58bc9a0ea8a113594 (diff)
downloadgitlab-ce-374b8e95c38833d6aeee491b077bd43c023c0686.tar.gz
Merge branch '21076-deleted-merged-branches' into 'master'
Add button to delete all merged branches ## What does this MR do? 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. **Note** ~~This MR is WIP until MR !6408 is merged.~~ ## Are there points in the code the reviewer needs to double check? The UX of the actual "Delete merged branches" button. ## Why was this MR needed? Fixes #21076 ## Screenshots ![Branches page without "Delete all merged" button](/uploads/3a2936a83c3547a0fce92a74af880a2d/Screen_Shot_2016-10-17_at_20.06.30.png) Before: ![Screen_Shot_2016-10-17_at_20.07.11](/uploads/55efcebf4e0a45dbfc70ba4a11ca152c/Screen_Shot_2016-10-17_at_20.07.11.png) After: ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [x] API support added - Tests - [x] Added for this feature/bug - [x] All builds are passing - [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? Closes #21076 See merge request !6449
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/branches.rb12
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