Commit 4fa02461 authored by stuart@fivemicro.com's avatar stuart@fivemicro.com

Don't update git url if 'read' times out

Previous code checked the exit status of 'echo' instead of 'read' to
determine if the 'read' command had timed out.

TEST=Create a mirror of depot_tools.git, git clone it, then run
./update_depot_tools, see prompt for changing the URL, wait at
least 60 seconds and verify that you get the timeout message.

R=maruel@chromium.org
BUG=

Review URL: https://codereview.chromium.org/25110004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@227427 0039d316-1c4b-4281-b951-d872f2087c98
parent 49fb93c1
......@@ -79,8 +79,9 @@ function update_git_repo {
echo " $remote_url"
echo
read -t 60 -p "OK to update it to $CANONICAL_GIT_URL ? [Y/n] " -n 1
STATUS=$?
echo
if [ $? -ne "0" ]; then
if [[ $STATUS -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"
......
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