diff options
author | James Edwards-Jones <jedwardsjones@gitlab.com> | 2018-02-13 19:33:13 +0000 |
---|---|---|
committer | James Edwards-Jones <jedwardsjones@gitlab.com> | 2018-02-15 01:57:55 +0000 |
commit | c88fe70f90c885b0568cdf68e467d5b26bbb142b (patch) | |
tree | 52de8b41899f6e9071e7afda155960a02c0e1aaa /spec/lib/gitlab | |
parent | f7c662c733a2a24c044c1f0bad03cfc63f704258 (diff) | |
download | gitlab-ce-c88fe70f90c885b0568cdf68e467d5b26bbb142b.tar.gz |
Only check LFS integrity for first branch in pushjej/fix-slow-lfs-object-check
Diffstat (limited to 'spec/lib/gitlab')
-rw-r--r-- | spec/lib/gitlab/git_access_spec.rb | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/spec/lib/gitlab/git_access_spec.rb b/spec/lib/gitlab/git_access_spec.rb index 3c3697e7aa9..19d3f55501e 100644 --- a/spec/lib/gitlab/git_access_spec.rb +++ b/spec/lib/gitlab/git_access_spec.rb @@ -18,8 +18,9 @@ describe Gitlab::GitAccess do redirected_path: redirected_path) end - let(:push_access_check) { access.check('git-receive-pack', '_any') } - let(:pull_access_check) { access.check('git-upload-pack', '_any') } + let(:changes) { '_any' } + let(:push_access_check) { access.check('git-receive-pack', changes) } + let(:pull_access_check) { access.check('git-upload-pack', changes) } describe '#check with single protocols allowed' do def disable_protocol(protocol) @@ -646,6 +647,20 @@ describe Gitlab::GitAccess do end end + describe 'check LFS integrity' do + let(:changes) { ['6f6d7e7ed 570e7b2ab refs/heads/master', '6f6d7e7ed 570e7b2ab refs/heads/feature'] } + + before do + project.add_developer(user) + end + + it 'checks LFS integrity only for first change' do + expect_any_instance_of(Gitlab::Checks::LfsIntegrity).to receive(:objects_missing?).exactly(1).times + + push_access_check + end + end + describe '#check_push_access!' do before do merge_into_protected_branch |