mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
Make git-cl wrapper print errors instead of silently deleting repos.
It would previously delete and recreate git-cl-repo if it saw that the remote was different than expected. This looks like it was added for the transition from the old SVN repo to the new git one, but it also has the effect of losing any local changes that have been made in the repo. :-( Everyone should be updated by now, so print a helpful error and exit instead. Review URL: http://codereview.chromium.org/609002 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@39099 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
14
git-cl
14
git-cl
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Copyright (c) 2009 The Chromium Authors. All rights reserved.
|
# Copyright (c) 2010 The Chromium Authors. All rights reserved.
|
||||||
# Use of this source code is governed by a BSD-style license that can be
|
# Use of this source code is governed by a BSD-style license that can be
|
||||||
# found in the LICENSE file.
|
# found in the LICENSE file.
|
||||||
|
|
||||||
@@ -8,7 +8,19 @@ url="http://src.chromium.org/git/git-cl.git"
|
|||||||
cur_url=$(git config -f "$base_dir/git-cl-repo/.git/config" remote.origin.url)
|
cur_url=$(git config -f "$base_dir/git-cl-repo/.git/config" remote.origin.url)
|
||||||
|
|
||||||
if [ "$cur_url" != "$url" ]; then
|
if [ "$cur_url" != "$url" ]; then
|
||||||
|
cat <<EOF
|
||||||
|
$base_dir/git-cl-repo
|
||||||
|
is tracking a non-default remote repository:
|
||||||
|
|
||||||
|
default: $url
|
||||||
|
yours: $cur_url
|
||||||
|
|
||||||
|
This is intended to be an automatically-updating, read-only repository.
|
||||||
|
Please create a separate repository for making changes to git-cl, move your
|
||||||
|
modifications there, and then run:
|
||||||
rm -rf $base_dir/git-cl-repo
|
rm -rf $base_dir/git-cl-repo
|
||||||
|
EOF
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f "$base_dir/git-cl-repo/git-cl" ]; then
|
if [ ! -f "$base_dir/git-cl-repo/git-cl" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user