Expire the exists cache before deletion to ensure project dir actually exists
Closes #14659
This commit is contained in:
parent
c1834664a7
commit
2e328c1ea7
2 changed files with 3 additions and 1 deletions
|
@ -335,6 +335,8 @@ class Repository
|
|||
|
||||
# Runs code just before a repository is deleted.
|
||||
def before_delete
|
||||
expire_exists_cache
|
||||
|
||||
expire_cache if exists?
|
||||
|
||||
expire_root_ref_cache
|
||||
|
|
|
@ -558,7 +558,7 @@ describe Repository, models: true do
|
|||
end
|
||||
|
||||
it 'flushes the exists cache' do
|
||||
expect(repository).to receive(:expire_exists_cache)
|
||||
expect(repository).to receive(:expire_exists_cache).twice
|
||||
|
||||
repository.before_delete
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue