Commit 1712b688 authored by Shinya Maeda's avatar Shinya Maeda

Remove unnecessary existence check on persistent ref

This commit reduces the number of gitaly calls
parent 1c5076ae
......@@ -22,7 +22,7 @@ module Ci
end
def create
return unless enabled? && !exist?
return unless enabled?
create_ref(sha, path)
rescue => e
......
......@@ -73,8 +73,8 @@ describe Ci::PersistentRef do
pipeline.persistent_ref.create
end
it 'does not create a persistent ref' do
expect(project.repository).not_to receive(:create_ref)
it 'overwrites a persistent ref' do
expect(project.repository).to receive(:create_ref).and_call_original
subject
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment