Fix repository cache invalidation issue when project is recreated with an empty repo
To reproduce:
- Create a project with some content
- Rename the project
- Create a new project with the same name.
- 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.
Please review if this change has significant performance implications.
Closes #13384 (closed)