[email protected] | 565db0e | 2009-06-05 18:08:54 | [diff] [blame] | 1 | #!/bin/sh |
[email protected] | b7ec6aa | 2010-02-16 17:04:39 | [diff] [blame^] | 2 | # Copyright (c) 2010 The Chromium Authors. All rights reserved. |
[email protected] | 565db0e | 2009-06-05 18:08:54 | [diff] [blame] | 3 | # Use of this source code is governed by a BSD-style license that can be |
4 | # found in the LICENSE file. | ||||
5 | |||||
6 | base_dir=$(dirname "$0") | ||||
[email protected] | dffe494 | 2009-11-18 02:25:16 | [diff] [blame] | 7 | url="http://src.chromium.org/git/git-cl.git" |
8 | cur_url=$(git config -f "$base_dir/git-cl-repo/.git/config" remote.origin.url) | ||||
9 | |||||
10 | if [ "$cur_url" != "$url" ]; then | ||||
[email protected] | b7ec6aa | 2010-02-16 17:04:39 | [diff] [blame^] | 11 | cat <<EOF |
12 | $base_dir/git-cl-repo | ||||
13 | is tracking a non-default remote repository: | ||||
14 | |||||
15 | default: $url | ||||
16 | yours: $cur_url | ||||
17 | |||||
18 | This is intended to be an automatically-updating, read-only repository. | ||||
19 | Please create a separate repository for making changes to git-cl, move your | ||||
20 | modifications there, and then run: | ||||
[email protected] | dffe494 | 2009-11-18 02:25:16 | [diff] [blame] | 21 | rm -rf $base_dir/git-cl-repo |
[email protected] | b7ec6aa | 2010-02-16 17:04:39 | [diff] [blame^] | 22 | EOF |
23 | exit 1 | ||||
[email protected] | dffe494 | 2009-11-18 02:25:16 | [diff] [blame] | 24 | fi |
[email protected] | 565db0e | 2009-06-05 18:08:54 | [diff] [blame] | 25 | |
26 | if [ ! -f "$base_dir/git-cl-repo/git-cl" ]; then | ||||
[email protected] | dffe494 | 2009-11-18 02:25:16 | [diff] [blame] | 27 | git clone $url $base_dir/git-cl-repo -q |
[email protected] | 565db0e | 2009-06-05 18:08:54 | [diff] [blame] | 28 | fi |
29 | |||||
[email protected] | 43418e4 | 2009-06-09 19:47:40 | [diff] [blame] | 30 | $base_dir/git-cl-repo/git-cl "$@" |