diff options
author | Douwe Maan <douwe@gitlab.com> | 2018-02-15 12:23:19 +0300 |
---|---|---|
committer | Ian Baum <ibaum@gitlab.com> | 2018-02-23 21:02:54 +0300 |
commit | 0fe7ef299d86e16eeb722cf25f8f23b3fdf454a4 (patch) | |
tree | e4cb1e3eaf16d69e39faba1216870a32d1e0a5bc /spec | |
parent | fba43f49596ac794e743d1bb4a51fe8ad2d3f746 (diff) |
Merge branch 'jej/fix-slow-lfs-object-check' into 'master'
Only check LFS integrity for first branch in push
Closes #41141
See merge request gitlab-org/gitlab-ce!17098
Diffstat (limited to 'spec')
-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 |