throw(:error,error(_(%q(You are not allowed to push into this branch. Create another branch or open a merge request.)),:forbidden))unlesspush_authorized?
returnerror(_('There was an error updating the dashboard, branch name is invalid.'),:bad_request)unlessvalid_branch_name?
returnerror(_('There was an error updating the dashboard, branch named: %{branch} already exists.')%{branch: params[:branch]},:bad_request)unlessnew_or_default_branch?
returnerror(_('The file name should have a .yml extension'),:bad_request)unlesstarget_file_type_valid?
success(result)
end
# rubocop:disable Cop/BanCatchThrow
defbranch
@branch||=begin
throw(:error,error(_('There was an error updating the dashboard, branch name is invalid.'),:bad_request))unlessvalid_branch_name?
throw(:error,error(_('There was an error updating the dashboard, branch named: %{branch} already exists.')%{branch: params[:branch]},:bad_request))unlessnew_or_default_branch?
=s_('Environment variables are configured by your administrator to be %{link_start}protected%{link_end} by default').html_safe%{link_start: link_start,link_end: '</a>'.html_safe}