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