Commit 0861d587 authored by Stan Hu's avatar Stan Hu

Make Project's only_mirror_protected_branches value false by default

This `default_value_for` entry didn't actually do anything because by
default, the UI initialized the flag to `false` and the DB allows `nil`
values.  However, this ensures the model is consistent with that
behavior and avoids the pitfalls we saw in
https://gitlab.com/gitlab-org/gitlab-ce/issues/53515.

This is similar to the change made in
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/23410 for
remote mirrors.
parent a03f59d3
......@@ -100,7 +100,6 @@ module EE
end
default_value_for :packages_enabled, true
default_value_for :only_mirror_protected_branches, true
delegate :store_security_reports_available?, to: :namespace
end
......
......@@ -44,6 +44,12 @@ describe Projects::UpdateMirrorService do
expect(result[:status]).to eq(:success)
end
it "disables mirroring protected branches only by default" do
new_project = create(:project, :repository, :mirror, import_url: Project::UNKNOWN_IMPORT_URL)
expect(new_project.only_mirror_protected_branches).to be_falsey
end
context "updating tags" do
it "creates new tags" do
stub_fetch_mirror(project)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment