|
@@ -33,7 +33,6 @@ IF EXIST "%DEPOT_TOOLS_DIR%.disable_auto_update" GOTO :EOF
|
|
|
IF "%DEPOT_TOOLS_UPDATE%" == "0" GOTO :EOF
|
|
|
|
|
|
echo Updating depot_tools...
|
|
|
-set GIT_URL=https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
|
|
|
|
|
:: Download git for the first time if it's not present.
|
|
|
call git --version > nul 2>&1
|
|
@@ -56,21 +55,6 @@ IF NOT EXIST "%DEPOT_TOOLS_DIR%.git" (
|
|
|
)
|
|
|
|
|
|
cd /d "%DEPOT_TOOLS_DIR%."
|
|
|
-call git config remote.origin.fetch > NUL
|
|
|
-for /F %%x in ('git config --get remote.origin.url') DO (
|
|
|
- IF not "%%x" == "%GIT_URL%" (
|
|
|
- echo Your depot_tools checkout is configured to fetch from an obsolete URL
|
|
|
- choice /N /T 60 /D N /M "Would you like to update it? [y/N]: "
|
|
|
- IF not errorlevel 2 (
|
|
|
- call git config remote.origin.url "%GIT_URL%"
|
|
|
- )
|
|
|
- )
|
|
|
-)
|
|
|
-:: depot_tools.zip archives generated before 2021-03-12 have instruction to
|
|
|
-:: fetch only from old default git branch. Such branch won't be available
|
|
|
-:: evenutally, so fetch config needs to be updated.
|
|
|
-call git config --unset-all remote.origin.fetch
|
|
|
-call git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
|
|
|
call git fetch -q origin > NUL
|
|
|
call git checkout -q origin/main > NUL
|
|
|
if errorlevel 1 (
|