diff options
author | Robert Speicher <robert@gitlab.com> | 2017-12-21 00:25:15 +0300 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2017-12-21 00:25:15 +0300 |
commit | 95c5d0d92ba5633b710b501ab64548789cbe4601 (patch) | |
tree | 0ff75c3a0a0426745449a0d1fde3b7f2249e4d45 /spec | |
parent | e0a27ee419b55509204ba2bfbdbfbab3c7c331bc (diff) | |
parent | 28fba5ed99c6f8b4e7e534f9c2046d1c5ab38607 (diff) |
Merge branch 'revert-b655a4a7' into 'master'
Revert "Move Repository#write_ref to Git::Repository#write_ref"
Closes #41143
[ci skip]
See merge request gitlab-org/gitlab-ce!16055
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/project_spec.rb | 5 | ||||
-rw-r--r-- | spec/models/repository_spec.rb | 17 |
2 files changed, 2 insertions, 20 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index f805f2dcddb..cbeac2f05d3 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -1863,11 +1863,10 @@ describe Project do project.change_head(project.default_branch) end - it 'creates the new reference' do - expect(project.repository.raw_repository).to receive(:write_ref).with('HEAD', + it 'creates the new reference with rugged' do + expect(project.repository.rugged.references).to receive(:create).with('HEAD', "refs/heads/#{project.default_branch}", force: true) - project.change_head(project.default_branch) end diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb index 1d7069feebd..9a68ae086ea 100644 --- a/spec/models/repository_spec.rb +++ b/spec/models/repository_spec.rb @@ -1979,23 +1979,6 @@ describe Repository do File.delete(path) end - - it "attempting to call keep_around when exists a lock does not fail" do - ref = repository.send(:keep_around_ref_name, sample_commit.id) - path = File.join(repository.path, ref) - lock_path = "#{path}.lock" - - FileUtils.mkdir_p(File.dirname(path)) - File.open(lock_path, 'w') { |f| f.write('') } - - begin - expect { repository.keep_around(sample_commit.id) }.not_to raise_error(Gitlab::Git::Repository::GitError) - - expect(File.exist?(lock_path)).to be_falsey - ensure - File.delete(path) - end - end end describe '#update_ref' do |