2017-08-17 22:00:37 +05:30
|
|
|
class Projects::ProtectedBranchesController < Projects::ProtectedRefsController
|
|
|
|
protected
|
2014-09-02 18:07:02 +05:30
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
def project_refs
|
|
|
|
@project.repository.branches
|
2015-04-26 12:48:37 +05:30
|
|
|
end
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
def create_service_class
|
|
|
|
::ProtectedBranches::CreateService
|
2016-08-24 12:49:21 +05:30
|
|
|
end
|
2015-04-26 12:48:37 +05:30
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
def update_service_class
|
|
|
|
::ProtectedBranches::UpdateService
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
def load_protected_ref
|
|
|
|
@protected_ref = @project.protected_branches.find(params[:id])
|
2016-08-24 12:49:21 +05:30
|
|
|
end
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
def protected_ref_params
|
2016-09-13 17:45:13 +05:30
|
|
|
params.require(:protected_branch).permit(:name,
|
|
|
|
merge_access_levels_attributes: [:access_level, :id],
|
|
|
|
push_access_levels_attributes: [:access_level, :id])
|
|
|
|
end
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|