diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-05-23 15:34:02 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-05-23 15:34:02 +0300 |
commit | d575ee3e90a7b13e4ed29fdea0b611ae8ef50496 (patch) | |
tree | f5b13df2d0de14f80ae3c8833179e72ceb0dc699 /lib/api/branches.rb | |
parent | 8ae2d2152b197931725a3f4b9aa3697f37988c20 (diff) | |
download | gitlab-ce-d575ee3e90a7b13e4ed29fdea0b611ae8ef50496.tar.gz |
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.rb | 8 |
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 |