diff options
author | Stan Hu <stanhu@gmail.com> | 2018-03-30 02:10:43 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-04-06 18:17:07 +0300 |
commit | a18eea8c32381b9514083e796a8504fdfc2c81d9 (patch) | |
tree | 85643264b363a582baf884d2df518450323d13aa /spec/lib/gitlab/git_access_spec.rb | |
parent | 44f4a674e2a87d104f700265d835aba000c589f0 (diff) |
Automatically cleanup stale worktrees and lock files upon a push
git 2.16 will fail badly if there are stale worktrees.
Closes #44115
Diffstat (limited to 'spec/lib/gitlab/git_access_spec.rb')
-rw-r--r-- | spec/lib/gitlab/git_access_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/lib/gitlab/git_access_spec.rb b/spec/lib/gitlab/git_access_spec.rb index b845abab5ef..c870997e274 100644 --- a/spec/lib/gitlab/git_access_spec.rb +++ b/spec/lib/gitlab/git_access_spec.rb @@ -855,6 +855,20 @@ describe Gitlab::GitAccess do admin: { push_protected_branch: false, push_all: false, merge_into_protected_branch: false })) end end + + context 'when pushing to a project' do + let(:project) { create(:project, :public, :repository) } + let(:changes) { "#{Gitlab::Git::BLANK_SHA} 570e7b2ab refs/heads/wow" } + + before do + project.add_developer(user) + end + + it 'cleans up the files' do + expect(project.repository).to receive(:clean_stale_repository_files).and_call_original + expect { push_access_check }.not_to raise_error + end + end end describe 'build authentication abilities' do |