Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-05-23 16:34:02 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-05-23 16:34:02 +0400
commitd575ee3e90a7b13e4ed29fdea0b611ae8ef50496 (patch)
treef5b13df2d0de14f80ae3c8833179e72ceb0dc699 /lib/api/branches.rb
parent8ae2d2152b197931725a3f4b9aa3697f37988c20 (diff)
Improve branch deletion via API
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'lib/api/branches.rb')
-rw-r--r--lib/api/branches.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/api/branches.rb b/lib/api/branches.rb
index 32597eb94c4..b32a4aa7bc2 100644
--- a/lib/api/branches.rb
+++ b/lib/api/branches.rb
@@ -94,7 +94,13 @@ module API
# DELETE /projects/:id/repository/branches/:branch
delete ":id/repository/branches/:branch" do
authorize_push_project
- DeleteBranchService.new.execute(user_project, params[:branch], current_user)
+ result = DeleteBranchService.new.execute(user_project, params[:branch], current_user)
+
+ if result[:state] == :success
+ true
+ else
+ render_api_error!(result[:message], 405)
+ end
end
end
end