Index: update_depot_tools |
diff --git a/update_depot_tools b/update_depot_tools |
index 3ad917a8fdafa34dd7da1628d219185a64c2fe81..61924d1285a855ccee0f0d5eebef721b5ed312c1 100755 |
--- a/update_depot_tools |
+++ b/update_depot_tools |
@@ -22,6 +22,8 @@ fi |
OUTPUT="$(uname | grep 'MINGW')" |
MINGW=$? |
+CANONICAL_GIT_URL="https://chromium.googlesource.com/chromium/tools/depot_tools" |
M-A Ruel
2013/01/07 16:19:18
Wouldn't it be better to use ".../depot_tools.git"
|
+ |
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 |