From 6c81fd0ae32e9940976cc734a4a7b396d81801c1 Mon Sep 17 00:00:00 2001 From: Anne Redulla Date: Thu, 6 Feb 2025 14:56:24 -0800 Subject: [PATCH] Revert "[win-bootstrap] Cleanup update_depot_tools.bat for lack of git-for-windows" This reverts commit 524abbc50ed9c0d539d00af1b5d8c57bc04d61f1. Reason for revert: restore calling `bootstrap\win_tools.bat` on git error to fix b/394767578 Original change's description: > [win-bootstrap] Cleanup update_depot_tools.bat for lack of git-for-windows > > Bug: b/360206460 > Change-Id: I1a4d9ac8a4e0f19356e22bc15a664cc838e52cd3 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6205947 > Reviewed-by: Josip Sokcevic > Commit-Queue: Anne Redulla Bug: b/360206460 Change-Id: Ifdec35e6ce594688f461f132f302c5b803640409 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6238906 Reviewed-by: Josip Sokcevic Bot-Commit: Rubber Stamper Commit-Queue: Anne Redulla --- update_depot_tools.bat | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/update_depot_tools.bat b/update_depot_tools.bat index a351561155..b4d6b26ba3 100644 --- a/update_depot_tools.bat +++ b/update_depot_tools.bat @@ -34,13 +34,16 @@ IF "%DEPOT_TOOLS_UPDATE%" == "0" GOTO :EOF echo Updating depot_tools... -:: Test git is installed by checking its version. +:: Download git for the first time if it's not present. call git --version > nul 2>&1 -if %ERRORLEVEL% NEQ 0 ( - echo Git isn't installed. Please install it. +if %ERRORLEVEL% == 0 goto :GIT_UPDATE +call "%DEPOT_TOOLS_DIR%bootstrap\win_tools.bat" +if errorlevel 1 ( + echo Error updating depot_tools, no revision tool found. exit /b %ERRORLEVEL% ) +:GIT_UPDATE :: Now clear errorlevel so it can be set by other programs later. set errorlevel= @@ -62,5 +65,5 @@ if errorlevel 1 ( :: Sync CIPD and CIPD client tools. call "%~dp0\cipd_bin_setup.bat" -:: Update python. +:: Update git and python. call "%DEPOT_TOOLS_DIR%bootstrap\win_tools.bat"