Bug 1184594 - git 'repo' is not deployed correctly on build machines managed by buildbot. r=hwine
--- a/mozharness/mozilla/building/buildb2gbase.py
+++ b/mozharness/mozilla/building/buildb2gbase.py
@@ -342,16 +342,21 @@ class B2GBuildBaseScript(BuildbotMixin,
# self.vcs_checkout already retries, so no need to wrap it in
# self.retry. We set the error_level to ERROR to prevent it going fatal
# so we can do our own handling here.
retval = self.vcs_checkout_repos(repos, error_level=ERROR)
if not retval:
self.rmtree(repo_dir)
self.fatal("Automation Error: couldn't clone repo", exit_code=4)
+ # Repo self-updates if the checkout is on a detached head. Creating a
+ # branch works around the problem.
+ git = self.query_exe("git")
+ self.run_command([git, 'checkout', '-B', 'tmp_moz_branch', repo_rev],
+ cwd=repo_dir, halt_on_failure=True)
return retval
def checkout_tools(self):
dirs = self.query_abs_dirs()
# We need hg.m.o/build/tools checked out
self.info("Checking out tools")
repos = [{