Add detection for locked git repos.

R=mithro@mithis.com, mmoss@chromium.org, vadimsh@chromium.org
BUG=405426

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@297850 0039d316-1c4b-4281-b951-d872f2087c98
changes/01/332501/1
iannucci@chromium.org 10 years ago
parent aa1dfdab66
commit d9b318cff1

@ -1076,6 +1076,14 @@ class GitWrapper(SCMWrapper):
os.path.isdir(os.path.join(g, "rebase-apply")))
def _CheckClean(self, rev_str):
lockfile = os.path.join(self.checkout_path, ".git", "index.lock")
if os.path.exists(lockfile):
raise gclient_utils.Error(
'\n____ %s%s\n'
'\tYour repo is locked, possibly due to a concurrent git process.\n'
'\tIf no git executable is running, then clean up %r and try again.\n'
% (self.relpath, rev_str, lockfile))
# Make sure the tree is clean; see git-rebase.sh for reference
try:
scm.GIT.Capture(['update-index', '--ignore-submodules', '--refresh'],

Loading…
Cancel
Save