[win-bootstrap] Use flag to enable direct install git

By default it's false and the bundled git is used.

Bug: b/379888465
Change-Id: I7d3d91da2ade6534d5b80479a050d6f608c16b2e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6033861
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Auto-Submit: Anne Redulla <aredulla@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
changes/61/6033861/3
Anne Redulla 8 months ago committed by LUCI CQ
parent 56d4cf54ae
commit fbb90a5af2

@ -354,6 +354,11 @@ def main(argv):
parser.add_argument('--bootstrap-name',
required=True,
help='The directory of the Python installation.')
parser.add_argument(
'--use-system-git',
action='store_true',
help='Whether to prefer a direct git installation over a depot_tools '
'bundled git.')
args = parser.parse_args(argv)
logging.basicConfig(level=logging.DEBUG if args.verbose else logging.WARN)
@ -372,9 +377,13 @@ def main(argv):
bootstrap_git_dir = os.path.join(bootstrap_dir, 'git')
# Avoid messing with system git docs.
add_docs = False
git_dir = search_win_git_directory()
git_dir = None
if args.use_system_git:
git_dir = search_win_git_directory()
if not git_dir:
# git not found in PATH - fall back to depot_tools bundled git.
# Either using system git was not enabled
# or git was not found in PATH.
# Fall back to depot_tools bundled git.
git_dir = bootstrap_git_dir
add_docs = True
template = template._replace(GIT_BIN_ABSDIR=git_dir)

Loading…
Cancel
Save