Skip to content
Snippets Groups Projects
Commit d023a852 authored by Yasser Hussain's avatar Yasser Hussain
Browse files

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'.
parent 74313988
No related branches found
No related tags found
No related merge requests found
Loading
@@ -64,7 +64,7 @@ module API
Loading
@@ -64,7 +64,7 @@ module API
authorize_admin_project authorize_admin_project
   
@branch = user_project.repository.find_branch(params[:branch]) @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 = user_project.protected_branches.find_by(name: @branch.name)
protected_branch.destroy if protected_branch protected_branch.destroy if protected_branch
   
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment