Call _UpdateBranchHeads within _Clone.
This will avoid errors where _Clone is called for a new DEP, but where the DEP
refers to a branch commit, thus causing the clone to fail because it can't
checkout that commit (such as happens currently with 'fetch v8').
Review URL: https://codereview.chromium.org/307223006
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@274347 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/gclient_scm.py b/gclient_scm.py
index 12a428c..26d9658 100644
--- a/gclient_scm.py
+++ b/gclient_scm.py
@@ -376,7 +376,6 @@
except subprocess2.CalledProcessError:
self._DeleteOrMove(options.force)
self._Clone(revision, url, options)
- self._UpdateBranchHeads(options, fetch=True)
if deps_revision and deps_revision.startswith('branch-heads/'):
deps_branch = deps_revision.replace('branch-heads/', '')
self._Capture(['branch', deps_branch, deps_revision])
@@ -821,6 +820,7 @@
if os.listdir(tmp_dir):
self.Print('_____ removing non-empty tmp dir %s' % tmp_dir)
gclient_utils.rmtree(tmp_dir)
+ self._UpdateBranchHeads(options, fetch=True)
self._Run(['checkout', '--quiet', revision.replace('refs/heads/', '')],
options)
if self._GetCurrentBranch() is None: