Skip to content

Commit

Permalink
Only clear cache locks if the cache exists.
Browse files Browse the repository at this point in the history
BUG=407259
TEST=None

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@291609 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
danjacques committed Aug 25, 2014
1 parent 68a4fa6 commit b682b3e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,7 @@ def SetConfig(self, content):
cache_dir = os.path.join(self.root_dir, cache_dir)
cache_dir = os.path.abspath(cache_dir)
# If running on a bot, force break any stale git cache locks.
if os.environ.get('CHROME_HEADLESS'):
if os.path.exists(cache_dir) and os.environ.get('CHROME_HEADLESS'):
subprocess2.check_call(['git', 'cache', 'unlock', '--cache-dir',
cache_dir, '--force', '--all'])
gclient_scm.GitWrapper.cache_dir = cache_dir
Expand Down

0 comments on commit b682b3e

Please sign in to comment.