Changed the argument of not_found for 'unprotect'

not_found appends string "Not Found" to the argument causing the resulting message to be "Branch does not exist Not Found" which is an incorrect error message.

Changed the argument of not_found! for 'unprotect'  command to "Branch" from "Branch does not exist".  This makes the final error message to appear as "Branch Not Found" which is correct and same as error messages for other commands like 'protect'.
This commit is contained in:
Yasser Hussain 2016-04-06 15:07:31 +05:30
parent 74313988ac
commit d023a85287
1 changed files with 1 additions and 1 deletions

View File

@ -64,7 +64,7 @@ module API
authorize_admin_project
@branch = user_project.repository.find_branch(params[:branch])
not_found!("Branch does not exist") unless @branch
not_found!("Branch") unless @branch
protected_branch = user_project.protected_branches.find_by(name: @branch.name)
protected_branch.destroy if protected_branch