[git] Remove hard-coded "depot_tools" Git.

Several tools, including the "git" recipe module, hard-code a
checkout-relative "git.bat" path. Git is a feature that is provided by
the system, both to tooling and recipes:

1) For users, "depot_tools" must be on PATH, and during setup it will
   have installed "git.bat", ensuring that Git tooling is available in
   PATH.
2) For bots, the system is responsible for providing "git.bat" on PATH.
   This is typically done at "/b/depot_tools/git.bat", which is sync'd
   through the "update_scripts" step.

By formally treating Git as a system resource, we absolve Windows bots
and users from manually installing a depot_tools-local Git, bringing
them in line with other platforms.

BUG=chromium:590806
TEST=local

Change-Id: I93e89855cdd330a2ba7a8cfb8117a1789d1ab54e
Reviewed-on: https://chromium-review.googlesource.com/568694
Commit-Queue: Daniel Jacques <dnj@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
This commit is contained in:
Dan Jacques
2017-07-12 11:40:20 -07:00
committed by Commit Bot
parent e8eed65fec
commit 209a681f9c
8 changed files with 60 additions and 123 deletions

View File

@@ -26,6 +26,8 @@ import subprocess
import sys
import textwrap
import git_common
from distutils import spawn
@@ -88,11 +90,8 @@ class GclientCheckout(Checkout):
class GitCheckout(Checkout):
def run_git(self, *cmd, **kwargs):
if sys.platform == 'win32' and not spawn.find_executable('git'):
git_path = os.path.join(SCRIPT_PATH, 'git.bat')
else:
git_path = 'git'
return self.run((git_path,) + cmd, **kwargs)
print 'Running: git %s' % (' '.join(pipes.quote(x) for x in cmd))
return git_common.run(*cmd, **kwargs)
class GclientGitCheckout(GclientCheckout, GitCheckout):