Commit 143c3ffe authored by szager@chromium.org's avatar szager@chromium.org

For git checkouts of depot_tools, update remote.origin.url to the git-on-borg mirror.

BUG=168205


Review URL: https://chromiumcodereview.appspot.com/11742032

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@175040 0039d316-1c4b-4281-b951-d872f2087c98
parent d2ea1dc5
......@@ -22,6 +22,8 @@ fi
OUTPUT="$(uname | grep 'MINGW')"
MINGW=$?
CANONICAL_GIT_URL="https://chromium.googlesource.com/chromium/tools/depot_tools"
SVN="svn"
if [ -d "$base_dir/svn_bin" -a $MINGW = 0 ]; then
SVN="$base_dir/svn_bin/svn.exe"
......@@ -70,6 +72,22 @@ function is_git_clone_repo {
}
function update_git_repo {
remote_url=$("$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
echo
if [ $? -ne "0" ]; then
echo "Timeout; not updating remote URL."
elif [ -z "$REPLY" -o "$REPLY" = "Y" -o "$REPLY" = "y" ]; then
"$GIT" config remote.origin.url "$CANONICAL_GIT_URL"
echo "Remote URL updated."
fi
fi
if is_git_clone_repo; then
git fetch -q origin &> /dev/null
local REBASE_TXT STATUS
......
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