Commit d9b318cf authored by iannucci@chromium.org's avatar iannucci@chromium.org

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
parent aa1dfdab
......@@ -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'],
......
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