2019-07-31 22:56:46 +05:30
- expanded = expanded_by_default?
2017-09-10 17:25:29 +05:30
2020-10-24 23:57:45 +05:30
%section.settings.no-animate#js-protected-branches-settings{ class: ('expanded' if expanded), data: { qa_selector: 'protected_branches_settings_content' } }
2017-09-10 17:25:29 +05:30
.settings-header
2021-04-17 20:07:23 +05:30
%h4.settings-title.js-settings-toggle.js-settings-toggle-trigger-only
2021-03-11 19:13:27 +05:30
Protected branches
2021-04-17 20:07:23 +05:30
%button.btn.gl-button.btn-default.js-settings-toggle.qa-expand-protected-branches{ type: 'button' }
2017-09-10 17:25:29 +05:30
= expanded ? 'Collapse' : 'Expand'
%p
2021-03-08 18:12:59 +05:30
Keep stable branches secure, and force developers to use merge requests. #{link_to "What are protected branches?", help_page_path("user/project/protected_branches")}
2018-03-17 18:26:18 +05:30
.settings-content
2017-09-10 17:25:29 +05:30
%p
2021-03-08 18:12:59 +05:30
By default, protected branches protect your code and:
2017-09-10 17:25:29 +05:30
%ul
2021-03-08 18:12:59 +05:30
%li Allow only users with Maintainer #{link_to "permissions", help_page_path("user/permissions")} to create new protected branches.
%li Allow only users with Maintainer permissions to push code.
2021-09-04 01:27:46 +05:30
%li Prevent <strong>anyone</strong> from #{link_to "force-pushing", help_page_path('topics/git/git_rebase', anchor: 'force-push')} to the branch.
2021-03-08 18:12:59 +05:30
%li Prevent <strong>anyone</strong> from deleting the branch.
2017-09-10 17:25:29 +05:30
- if can? current_user, :admin_project, @project
= content_for :create_protected_branch
= content_for :branches_list