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 ...@@ -22,7 +22,7 @@ module Ci
end end
def create def create
return unless enabled? && !exist? return unless enabled?
create_ref(sha, path) create_ref(sha, path)
rescue => e rescue => e
......
...@@ -73,8 +73,8 @@ describe Ci::PersistentRef do ...@@ -73,8 +73,8 @@ describe Ci::PersistentRef do
pipeline.persistent_ref.create pipeline.persistent_ref.create
end end
it 'does not create a persistent ref' do it 'overwrites a persistent ref' do
expect(project.repository).not_to receive(:create_ref) expect(project.repository).to receive(:create_ref).and_call_original
subject subject
end 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