Protecting a Branch is ignored when no repository exists
Summary
When an a project is created without a Git Repository, you are allowed to setup a protected branch within the UI.
However, upon saving this by clicking the Protect
button, the page refreshes and the protections never persist.
This is a problem when you want to protect branches prior to an initial commit - specifically when we're aiming to mirror an external repository but protect the branches initially.
Steps to reproduce
- Create an empty project
- Add a protected branch and save
- Validate that the protection disappears and without any warning.
Example Project
What is the current bug behavior?
What is the expected correct behavior?
Relevant logs and/or screenshots
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)
Possible fixes
Edited by Tim Poffenbarger