Commit 2e328c1e authored by Stan Hu's avatar Stan Hu

Expire the exists cache before deletion to ensure project dir actually exists

Closes #14659
parent c1834664
...@@ -335,6 +335,8 @@ class Repository ...@@ -335,6 +335,8 @@ class Repository
# Runs code just before a repository is deleted. # Runs code just before a repository is deleted.
def before_delete def before_delete
expire_exists_cache
expire_cache if exists? expire_cache if exists?
expire_root_ref_cache expire_root_ref_cache
......
...@@ -558,7 +558,7 @@ describe Repository, models: true do ...@@ -558,7 +558,7 @@ describe Repository, models: true do
end end
it 'flushes the exists cache' do it 'flushes the exists cache' do
expect(repository).to receive(:expire_exists_cache) expect(repository).to receive(:expire_exists_cache).twice
repository.before_delete repository.before_delete
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