Workaround for repo incompatibilities on buildbot.

Change-Id: Icd195f423e2e495d19ba35ed1d097e0f7d0a18ba
diff --git a/tools/buildbot-build.sh b/tools/buildbot-build.sh
index 12e0338..16d45c2 100755
--- a/tools/buildbot-build.sh
+++ b/tools/buildbot-build.sh
@@ -45,6 +45,16 @@
   fi
 done
 
+# Workaround for repo incompatibilities on the Chromium buildbot.
+# TODO: Remove this workaround once https://bugs.chromium.org/p/chromium/issues/detail?id=646329
+# is addressed.
+repo=$(which repo)
+if [[ $repo == *"depot_tools"* ]]; then
+  curl https://storage.googleapis.com/git-repo-downloads/repo > ./repo
+  chmod +x ./repo
+  ./repo sync $j_arg
+fi
+
 if [[ $mode == "host" ]]; then
   make_command="make $j_arg $showcommands build-art-host-tests $common_targets"
   make_command+=" ${out_dir}/host/linux-x86/lib/libjavacoretests.so "