Commit a5cda1e5 authored by hinoka@chromium.org's avatar hinoka@chromium.org

Remove the old cache dir before moving the bootstrapped cache dir into the real location

Seems like some combination of things (bad cache dir, shallow checkout, etc) causes
git cache to not clean up properly before trying to move new directory A into
already existing directory B.

So the logic is all there to detect that the cache is invalid, its just not
being cleaned up properly during shallow checkouts.

BUG=406864
TBR=iannucci

Review URL: https://codereview.chromium.org/499123002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@291587 0039d316-1c4b-4281-b951-d872f2087c98
parent e7585455
......@@ -416,6 +416,8 @@ class Mirror(object):
finally:
if tempdir:
try:
if os.path.exists(self.mirror_path):
gclient_utils.rmtree(self.mirror_path)
os.rename(tempdir, self.mirror_path)
except OSError as e:
# This is somehow racy on Windows.
......
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