2017-04-03 16:00:51 -04:00
|
|
|
class Projects::ProtectedBranchesController < Projects::ProtectedRefsController
|
|
|
|
protected
|
2012-02-15 16:51:04 -05:00
|
|
|
|
2017-04-03 16:00:51 -04:00
|
|
|
def project_refs
|
|
|
|
@project.repository.branches
|
2014-12-26 05:39:12 -05:00
|
|
|
end
|
|
|
|
|
2017-04-05 13:59:46 -04:00
|
|
|
def create_service_class
|
2017-04-03 16:00:51 -04:00
|
|
|
::ProtectedBranches::CreateService
|
2012-02-15 15:02:33 -05:00
|
|
|
end
|
2014-06-26 08:00:09 -04:00
|
|
|
|
2017-04-05 13:59:46 -04:00
|
|
|
def update_service_class
|
2017-04-03 16:00:51 -04:00
|
|
|
::ProtectedBranches::UpdateService
|
|
|
|
end
|
2014-06-26 08:00:09 -04:00
|
|
|
|
2017-04-03 16:00:51 -04:00
|
|
|
def load_protected_ref
|
2017-04-05 13:59:46 -04:00
|
|
|
@protected_ref = @project.protected_branches.find(params[:id])
|
2016-06-16 03:33:30 -04:00
|
|
|
end
|
|
|
|
|
2017-04-03 16:00:51 -04:00
|
|
|
def protected_ref_params
|
2016-07-29 02:13:07 -04:00
|
|
|
params.require(:protected_branch).permit(:name,
|
2017-05-05 11:59:31 -04:00
|
|
|
merge_access_levels_attributes: access_level_attributes,
|
|
|
|
push_access_levels_attributes: access_level_attributes)
|
2014-06-26 08:00:09 -04:00
|
|
|
end
|
2012-02-15 15:02:33 -05:00
|
|
|
end
|