| 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" | |
| 8 url="http://git.chromium.org/git/git-cl.git" | |
| 9 cur_url=$(git config -f "$repo/.git/config" remote.origin.url) | |
| 10 | 7 |
| 11 "$base_dir"/update_depot_tools | 8 "$base_dir"/update_depot_tools |
| 12 | 9 "$base_dir"/git_cl/git-cl "$@" |
| 13 if [ -e "$repo" -a "$cur_url" != "$url" ]; then | |
| 14 # Always override "origin" | |
| 15 (cd "$repo"; git remote set-url origin $url) | |
| 16 fi | |
| 17 | |
| 18 if [ ! -f "$repo/git-cl" ]; then | |
| 19 git clone $url $repo -q | |
| 20 elif [ ! -e "$repo/.git" ]; then | |
| 21 echo "$0: $repo does not appear to be a git repo" | |
| 22 elif [ "X$DEPOT_TOOLS_UPDATE" != "X0" ]; then | |
| 23 (cd "$repo"; git pull -q) | |
| 24 fi | |
| 25 | |
| 26 $repo/git-cl "$@" | |
| OLD | NEW |