| OLD | NEW |
| 1 #!/bin/sh | 1 #!/bin/sh |
| 2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 base_dir=$(dirname "$0") | 6 base_dir=$(dirname "$0") |
| 7 repo="$base_dir/git-cl-repo" | 7 repo="$base_dir/git-cl-repo" |
| 8 url="http://src.chromium.org/git/git-cl.git" | 8 url="http://src.chromium.org/git/git-cl.git" |
| 9 cur_url=$(git config -f "$repo/.git/config" remote.origin.url) | 9 cur_url=$(git config -f "$repo/.git/config" remote.origin.url) |
| 10 | 10 |
| 11 if [ -e "$repo" -a "$cur_url" != "$url" ]; then | 11 if [ -e "$repo" -a "$cur_url" != "$url" ]; then |
| 12 cat <<EOF | 12 cat <<EOF |
| 13 $repo | 13 $repo |
| 14 is tracking a non-default remote repository: | 14 is tracking a non-default remote repository: |
| 15 | 15 |
| 16 default: $url | 16 default: $url |
| 17 yours: $cur_url | 17 yours: $cur_url |
| 18 | 18 |
| 19 This is intended to be an automatically-updating, read-only repository. | 19 This is intended to be an automatically-updating, read-only repository. |
| 20 Please create a separate repository for making changes to git-cl, move your | 20 Please create a separate repository for making changes to git-cl, move your |
| 21 modifications there, and then run: | 21 modifications there, and then run: |
| 22 rm -rf $repo | 22 rm -rf $repo |
| 23 EOF | 23 EOF |
| 24 exit 1 | 24 exit 1 |
| 25 fi | 25 fi |
| 26 | 26 |
| 27 if [ ! -f "$repo/git-cl" ]; then | 27 if [ ! -f "$repo/git-cl" ]; then |
| 28 git clone $url $repo -q | 28 git clone $url $repo -q |
| 29 elif [ ! -e "$base_dir/git-cl-repo/.git" ]; then |
| 30 echo "$0: $base_dir/git-cl-repo does not appear to be a git repo" |
| 31 elif [ "X$DEPOT_TOOLS_UPDATE" != "X0" ]; then |
| 32 (cd "$base_dir/git-cl-repo"; git pull -q) |
| 29 fi | 33 fi |
| 30 | 34 |
| 31 $repo/git-cl "$@" | 35 $repo/git-cl "$@" |
| OLD | NEW |