Commit fa1d6ec2 authored by Valery Sizov's avatar Valery Sizov

Fix 'Geo: Don't attempt to expire the cache after a failed clone'

parent 3448d722
...@@ -18,7 +18,7 @@ module EE ...@@ -18,7 +18,7 @@ module EE
# Runs code after a repository has been synced. # Runs code after a repository has been synced.
def after_sync def after_sync
expire_all_method_caches expire_all_method_caches
expire_branch_cache expire_branch_cache if exists?
expire_content_cache expire_content_cache
end end
......
---
title: 'Fix ''Geo: Don''t attempt to expire the cache after a failed clone'''
merge_request:
author:
type: fixed
require 'spec_helper'
describe Repository do
include RepoHelpers
TestBlob = Struct.new(:path)
let(:project) { create(:project, :repository) }
let(:repository) { project.repository }
describe '#after_sync' do
it 'expires repository cache' do
expect(repository).to receive(:expire_all_method_caches)
expect(repository).to receive(:expire_branch_cache)
expect(repository).to receive(:expire_content_cache)
repository.after_sync
end
it 'does not call expire_branch_cache if repository does not exist' do
allow(repository).to receive(:exists?).and_return(false)
expect(repository).to receive(:expire_all_method_caches)
expect(repository).not_to receive(:expire_branch_cache)
expect(repository).to receive(:expire_content_cache)
repository.after_sync
end
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