Add feature flag to disable LFS check

This commit is contained in:
Igor 2019-04-23 13:01:17 +00:00 committed by Douwe Maan
parent a59b97d74b
commit fb1b1956d3
2 changed files with 13 additions and 0 deletions

View File

@ -7,6 +7,7 @@ module Gitlab
ERROR_MESSAGE = 'LFS objects are missing. Ensure LFS is properly set up or try a manual "git lfs push --all".'.freeze
def validate!
return unless Feature.enabled?(:lfs_check, default_enabled: true)
return unless project.lfs_enabled?
return if skip_lfs_integrity_check

View File

@ -27,6 +27,18 @@ describe Gitlab::Checks::LfsCheck do
allow(project).to receive(:lfs_enabled?).and_return(true)
end
context 'with lfs_check feature disabled' do
before do
stub_feature_flags(lfs_check: false)
end
it 'skips integrity check' do
expect_any_instance_of(Gitlab::Git::LfsChanges).not_to receive(:new_pointers)
subject.validate!
end
end
context 'deletion' do
let(:changes) { { oldrev: oldrev, ref: ref } }