Skip to content
Snippets Groups Projects
Commit baf49812 authored by Alex Kalderimis's avatar Alex Kalderimis
Browse files

Merge branch 'rugged_tags' into 'master'

Rewrite rugged tag updates to use gitaly RPCs

See merge request !91327
parents 27746d22 e2065c25
No related branches found
No related tags found
1 merge request!91327Rewrite rugged tag updates to use gitaly RPCs
Pipeline #576450920 passed
...@@ -525,7 +525,7 @@ def submodule_url(path) ...@@ -525,7 +525,7 @@ def submodule_url(path)
it 'does not error when dereferenced_target is nil' do it 'does not error when dereferenced_target is nil' do
blob_id = repository.blob_at('master', 'README.md').id blob_id = repository.blob_at('master', 'README.md').id
repository_rugged.tags.create("refs/tags/blob-tag", blob_id) repository.add_tag("refs/tags/blob-tag", user: user, target: blob_id)
expect { subject }.not_to raise_error expect { subject }.not_to raise_error
end end
......
...@@ -125,11 +125,11 @@ def expect_to_raise_storage_error ...@@ -125,11 +125,11 @@ def expect_to_raise_storage_error
let(:latest_tag) { 'v0.0.0' } let(:latest_tag) { 'v0.0.0' }
before do before do
rugged_repo(repository).tags.create(latest_tag, repository.commit.id) repository.add_tag(user, latest_tag, repository.commit.id)
end end
after do after do
rugged_repo(repository).tags.delete(latest_tag) repository.rm_tag(user, latest_tag)
end end
context 'desc' do context 'desc' do
...@@ -150,16 +150,13 @@ def expect_to_raise_storage_error ...@@ -150,16 +150,13 @@ def expect_to_raise_storage_error
subject { repository.tags_sorted_by('updated_asc').map(&:name) & (tags_to_compare + [annotated_tag_name]) } subject { repository.tags_sorted_by('updated_asc').map(&:name) & (tags_to_compare + [annotated_tag_name]) }
before do before do
options = { message: 'test tag message\n', repository.add_tag(user, annotated_tag_name, 'a48e4fc218069f68ef2e769dd8dfea3991362175', 'test tag message\n')
tagger: { name: 'John Smith', email: 'john@gmail.com' } }
rugged_repo(repository).tags.create(annotated_tag_name, 'a48e4fc218069f68ef2e769dd8dfea3991362175', **options)
end end
it { is_expected.to eq(['v1.0.0', 'v1.1.0', annotated_tag_name]) } it { is_expected.to eq(['v1.0.0', 'v1.1.0', annotated_tag_name]) }
after do after do
rugged_repo(repository).tags.delete(annotated_tag_name) repository.rm_tag(user, annotated_tag_name)
end end
end end
end end
......
...@@ -138,7 +138,7 @@ ...@@ -138,7 +138,7 @@
before do before do
# Create the lightweight tag # Create the lightweight tag
rugged_repo(project.repository).tags.create(tag_name, newrev) project.repository.write_ref("refs/tags/#{tag_name}", newrev)
# Clear tag list cache # Clear tag list cache
project.repository.expire_tags_cache project.repository.expire_tags_cache
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment