Commit 418f021a authored by Will Cassella's avatar Will Cassella Committed by LUCI CQ

Print helpful error message when updating depot_tools on Windows

The depot_tools directory may get into a state in which its no longer a
git repo, in which case we can't update it. On Windows this would cause
the update_depot_tools.bat script to fail with a somewhat confusing
error message, this CL fixes that to inform the user what happened and
what they should do about it.

Bug: 1333997
Change-Id: I2c60fc46f1fae7811ff6610e25380d08010d0597
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3718926Reviewed-by: 's avatarBruce Dawson <brucedawson@chromium.org>
Commit-Queue: Will Cassella <cassew@chromium.org>
Reviewed-by: 's avatarBrian Sheedy <bsheedy@chromium.org>
Reviewed-by: 's avatarAravind Vasudevan <aravindvasudev@google.com>
parent 3ffbdfdb
......@@ -48,6 +48,13 @@ if errorlevel 1 (
:: Now clear errorlevel so it can be set by other programs later.
set errorlevel=
:: Make sure DEPOT_TOOLS_DIR is a git repo
IF NOT EXIST "%DEPOT_TOOLS_DIR%.git\" (
echo Error: Your depot_tools directory does not appear to be a git repository, and cannot be updated.
echo Consider deleting your depot_tools directory and following the instructions at https://www.chromium.org/developers/how-tos/install-depot-tools/ to reinstall it.
exit /b 1
)
cd /d "%DEPOT_TOOLS_DIR%."
call git config remote.origin.fetch > NUL
for /F %%x in ('git config --get remote.origin.url') DO (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment