From 2ce7559d70e228963280df1f50176e9b2fa1e7b8 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Wed, 13 Apr 2016 00:00:15 -0700 Subject: Fix repository cache invalidation issue when project is recreated with an empty repo To reproduce: 1. Create a project with some content 2. Rename the project 3. Create a new project with the same name. 4. Boom - 404. After step 2, the branch and tag counts were not being cleared. This would cause `repository.has_visible_content?` to erroneously return `true` for the newly-created project. Closes #13384 --- spec/models/repository_spec.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'spec/models') diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb index 4e49c413f23..c3a4016fa49 100644 --- a/spec/models/repository_spec.rb +++ b/spec/models/repository_spec.rb @@ -393,6 +393,8 @@ describe Repository, models: true do describe '#expire_cache' do it 'expires all caches' do expect(repository).to receive(:expire_branch_cache) + expect(repository).to receive(:expire_branch_count_cache) + expect(repository).to receive(:expire_tag_count_cache) repository.expire_cache end -- cgit v1.2.1