blob: 67668ca760c3eae49b7ac4bfef39e1056da21b1d [file] [log] [blame]
[email protected]565db0e2009-06-05 18:08:541#!/bin/sh
[email protected]b7ec6aa2010-02-16 17:04:392# Copyright (c) 2010 The Chromium Authors. All rights reserved.
[email protected]565db0e2009-06-05 18:08:543# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6base_dir=$(dirname "$0")
[email protected]dffe4942009-11-18 02:25:167url="http://src.chromium.org/git/git-cl.git"
8cur_url=$(git config -f "$base_dir/git-cl-repo/.git/config" remote.origin.url)
9
10if [ "$cur_url" != "$url" ]; then
[email protected]b7ec6aa2010-02-16 17:04:3911 cat <<EOF
12$base_dir/git-cl-repo
13is tracking a non-default remote repository:
14
15 default: $url
16 yours: $cur_url
17
18This is intended to be an automatically-updating, read-only repository.
19Please create a separate repository for making changes to git-cl, move your
20modifications there, and then run:
[email protected]dffe4942009-11-18 02:25:1621 rm -rf $base_dir/git-cl-repo
[email protected]b7ec6aa2010-02-16 17:04:3922EOF
23 exit 1
[email protected]dffe4942009-11-18 02:25:1624fi
[email protected]565db0e2009-06-05 18:08:5425
26if [ ! -f "$base_dir/git-cl-repo/git-cl" ]; then
[email protected]dffe4942009-11-18 02:25:1627 git clone $url $base_dir/git-cl-repo -q
[email protected]565db0e2009-06-05 18:08:5428fi
29
[email protected]43418e42009-06-09 19:47:4030$base_dir/git-cl-repo/git-cl "$@"