mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 10:41:31 +00:00
Remove check for canonical depot_tools URL
The check was originally introduced as part of svn -> git migration, and no longer needed. This can use issues if user runs vendored depot_tools inside chromium/src. R=ddoman Bug: 347356471 Change-Id: I1a082886933f23e1d7c53f2da906d0727c180a75 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6209088 Reviewed-by: Scott Lee <ddoman@chromium.org> Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
This commit is contained in:
@@ -53,8 +53,6 @@ if [ $MINGW = 0 ]; then
|
||||
esac
|
||||
fi
|
||||
|
||||
CANONICAL_GIT_URL="https://chromium.googlesource.com/chromium/tools/depot_tools.git"
|
||||
|
||||
GIT="git"
|
||||
if [ -e "$base_dir/git.bat" -a $MINGW = 0 ]; then
|
||||
GIT="cmd.exe //c \"$base_dir\\git.bat\""
|
||||
@@ -78,21 +76,6 @@ function test_git {
|
||||
|
||||
function update_git_repo {
|
||||
remote_url=$(eval "$GIT" config --get remote.origin.url)
|
||||
if [ -n "$remote_url" -a "$remote_url" != "$CANONICAL_GIT_URL" ]; then
|
||||
echo "Your copy of depot_tools is configured to fetch from an obsolete URL:"
|
||||
echo
|
||||
echo " $remote_url"
|
||||
echo
|
||||
read -t 60 -p "OK to update it to $CANONICAL_GIT_URL ? [Y/n] " -n 1
|
||||
STATUS=$?
|
||||
echo
|
||||
if [[ $STATUS -ne 0 ]]; then
|
||||
echo "Timeout; not updating remote URL."
|
||||
elif [ -z "$REPLY" -o "$REPLY" = "Y" -o "$REPLY" = "y" ]; then
|
||||
eval "$GIT" config remote.origin.url "$CANONICAL_GIT_URL"
|
||||
echo "Remote URL updated."
|
||||
fi
|
||||
fi
|
||||
|
||||
local GIT_CMD_TXT STATUS
|
||||
GIT_CMD_TXT=$(git fetch -q origin main 2>&1)
|
||||
|
||||
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user