blob: 67668ca760c3eae49b7ac4bfef39e1056da21b1d [file] [log] [blame]
maruel@chromium.org565db0e2009-06-05 18:08:54 +00001#!/bin/sh
derat@chromium.orgb7ec6aa2010-02-16 17:04:39 +00002# Copyright (c) 2010 The Chromium Authors. All rights reserved.
maruel@chromium.org565db0e2009-06-05 18:08:54 +00003# 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")
msb@chromium.orgdffe4942009-11-18 02:25:16 +00007url="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
derat@chromium.orgb7ec6aa2010-02-16 17:04:39 +000011 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:
msb@chromium.orgdffe4942009-11-18 02:25:16 +000021 rm -rf $base_dir/git-cl-repo
derat@chromium.orgb7ec6aa2010-02-16 17:04:39 +000022EOF
23 exit 1
msb@chromium.orgdffe4942009-11-18 02:25:16 +000024fi
maruel@chromium.org565db0e2009-06-05 18:08:54 +000025
26if [ ! -f "$base_dir/git-cl-repo/git-cl" ]; then
msb@chromium.orgdffe4942009-11-18 02:25:16 +000027 git clone $url $base_dir/git-cl-repo -q
maruel@chromium.org565db0e2009-06-05 18:08:54 +000028fi
29
maruel@chromium.org43418e42009-06-09 19:47:40 +000030$base_dir/git-cl-repo/git-cl "$@"