#214: refactoring of Tree#destroy action according to Alexander's comments

This commit is contained in:
Vokhmin Alexey V 2013-07-19 14:22:29 +04:00
parent e7c00740b0
commit 1fb472d416
1 changed files with 2 additions and 5 deletions

View File

@ -40,11 +40,8 @@ class Projects::Git::TreesController < Projects::Git::BaseController
end
def destroy
if @branch && @project.delete_branch(@branch, current_user)
render :nothing => true
else
render :nothing => true, :status => 422
end
status = @branch && @project.delete_branch(@branch, current_user) ? 200 : 422
render :nothing => true, :status => status
end
def branches