Commit c2c448c0 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch '334754-fj-remove-feature-flag-wiki-uses-default-branch' into 'master'

Wiki repositories use default branch when creating the repo

See merge request gitlab-org/gitlab!65221
parents ef248304 e1743a5e
......@@ -249,8 +249,6 @@ class Wiki
override :default_branch
def default_branch
return 'master' if Feature.disabled?(:wiki_uses_default_branch, user, default_enabled: :yaml)
super || wiki.class.default_ref(container)
end
......
---
name: wiki_uses_default_branch
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/64891
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/334754
milestone: '14.1'
type: development
group: group::editor
default_enabled: false
......@@ -545,22 +545,12 @@ RSpec.shared_examples 'wiki model' do
allow(Gitlab::DefaultBranch).to receive(:value).and_return('main')
end
shared_examples 'feature flag wiki_uses_default_branch is disabled' do
it 'returns "master"' do
stub_feature_flags(wiki_uses_default_branch: false)
expect(subject).to eq 'master'
end
end
context 'when repository is not created' do
let(:wiki_container) { wiki_container_without_repo }
it 'returns the instance default branch' do
expect(subject).to eq 'main'
end
it_behaves_like 'feature flag wiki_uses_default_branch is disabled'
end
context 'when repository is empty' do
......@@ -573,8 +563,6 @@ RSpec.shared_examples 'wiki model' do
it 'returns the instance default branch' do
expect(subject).to eq 'main'
end
it_behaves_like 'feature flag wiki_uses_default_branch is disabled'
end
context 'when repository is not empty' do
......
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