2015-04-30 17:06:18 +00:00
|
|
|
- page_title "Protected branches"
|
2012-02-15 20:02:33 +00:00
|
|
|
|
2016-04-26 14:50:31 +00:00
|
|
|
.row.prepend-top-default.append-bottom-default
|
|
|
|
.col-lg-3
|
|
|
|
%h4.prepend-top-0
|
|
|
|
= page_title
|
2016-06-17 05:51:17 +00:00
|
|
|
%p Keep stable branches secure and force developers to use merge requests.
|
|
|
|
%p.prepend-top-20
|
|
|
|
Protected branches are designed to:
|
2016-04-26 14:50:31 +00:00
|
|
|
%ul
|
|
|
|
%li prevent pushes from everybody except #{link_to "masters", help_page_path("permissions", "permissions"), class: "vlink"}
|
|
|
|
%li prevent anyone from force pushing to the branch
|
|
|
|
%li prevent anyone from deleting the branch
|
|
|
|
%p.append-bottom-0 Read more about #{link_to "project permissions", help_page_path("permissions", "permissions"), class: "underlined-link"}
|
2016-06-17 05:51:17 +00:00
|
|
|
.col-lg-9
|
|
|
|
%h5.prepend-top-0
|
|
|
|
Protect a branch
|
2016-04-26 14:50:31 +00:00
|
|
|
- if can? current_user, :admin_project, @project
|
|
|
|
= form_for [@project.namespace.becomes(Namespace), @project, @protected_branch] do |f|
|
|
|
|
= form_errors(@protected_branch)
|
2012-02-15 20:02:33 +00:00
|
|
|
|
2016-04-26 14:50:31 +00:00
|
|
|
.form-group
|
|
|
|
= f.label :name, "Branch", class: "label-light"
|
2016-06-16 07:33:30 +00:00
|
|
|
= f.text_field(:name)
|
|
|
|
%p.help-block
|
2016-06-20 07:39:33 +00:00
|
|
|
= link_to "Wildcards", help_page_path(category: 'workflow', file: 'protected_branches', format: 'md', anchor: "wildcard-protected-branches")
|
|
|
|
such as
|
2016-06-16 07:33:30 +00:00
|
|
|
%code *-stable
|
|
|
|
or
|
|
|
|
%code production/*
|
|
|
|
are supported.
|
|
|
|
|
2016-04-26 14:50:31 +00:00
|
|
|
.form-group
|
|
|
|
= f.check_box :developers_can_push, class: "pull-left"
|
|
|
|
.prepend-left-20
|
|
|
|
= f.label :developers_can_push, "Developers can push", class: "label-light append-bottom-0"
|
|
|
|
%p.light.append-bottom-0
|
|
|
|
Allow developers to push to this branch
|
2016-06-17 05:51:17 +00:00
|
|
|
= f.submit "Protect", class: "btn-create btn protect-branch-btn", disabled: true
|
2016-04-26 14:50:31 +00:00
|
|
|
%hr
|
|
|
|
= render "branches_list"
|
2016-06-16 07:33:30 +00:00
|
|
|
|
|
|
|
:javascript
|
|
|
|
$("#protected_branch_name").select2({
|
|
|
|
placeholder: "Select branch",
|
|
|
|
createSearchChoice: function(term) { return { id: term, text: term }; },
|
|
|
|
data: gon.open_branches
|
|
|
|
})
|