1*baba6a3cSShawn O. Pearce#!/bin/sh 2*baba6a3cSShawn O. Pearce# Copyright (C) 2009, Google Inc. 3*baba6a3cSShawn O. Pearce# and other copyright owners as documented in the project's IP log. 4*baba6a3cSShawn O. Pearce# 5*baba6a3cSShawn O. Pearce# This program and the accompanying materials are made available 6*baba6a3cSShawn O. Pearce# under the terms of the Eclipse Distribution License v1.0 which 7*baba6a3cSShawn O. Pearce# accompanies this distribution, is reproduced below, and is 8*baba6a3cSShawn O. Pearce# available at http://www.eclipse.org/org/documents/edl-v10.php 9*baba6a3cSShawn O. Pearce# 10*baba6a3cSShawn O. Pearce# All rights reserved. 11*baba6a3cSShawn O. Pearce# 12*baba6a3cSShawn O. Pearce# Redistribution and use in source and binary forms, with or 13*baba6a3cSShawn O. Pearce# without modification, are permitted provided that the following 14*baba6a3cSShawn O. Pearce# conditions are met: 15*baba6a3cSShawn O. Pearce# 16*baba6a3cSShawn O. Pearce# - Redistributions of source code must retain the above copyright 17*baba6a3cSShawn O. Pearce# notice, this list of conditions and the following disclaimer. 18*baba6a3cSShawn O. Pearce# 19*baba6a3cSShawn O. Pearce# - Redistributions in binary form must reproduce the above 20*baba6a3cSShawn O. Pearce# copyright notice, this list of conditions and the following 21*baba6a3cSShawn O. Pearce# disclaimer in the documentation and/or other materials provided 22*baba6a3cSShawn O. Pearce# with the distribution. 23*baba6a3cSShawn O. Pearce# 24*baba6a3cSShawn O. Pearce# - Neither the name of the Eclipse Foundation, Inc. nor the 25*baba6a3cSShawn O. Pearce# names of its contributors may be used to endorse or promote 26*baba6a3cSShawn O. Pearce# products derived from this software without specific prior 27*baba6a3cSShawn O. Pearce# written permission. 28*baba6a3cSShawn O. Pearce# 29*baba6a3cSShawn O. Pearce# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 30*baba6a3cSShawn O. Pearce# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 31*baba6a3cSShawn O. Pearce# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 32*baba6a3cSShawn O. Pearce# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 33*baba6a3cSShawn O. Pearce# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 34*baba6a3cSShawn O. Pearce# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35*baba6a3cSShawn O. Pearce# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 36*baba6a3cSShawn O. Pearce# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 37*baba6a3cSShawn O. Pearce# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 38*baba6a3cSShawn O. Pearce# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 39*baba6a3cSShawn O. Pearce# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 40*baba6a3cSShawn O. Pearce# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 41*baba6a3cSShawn O. Pearce# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 42*baba6a3cSShawn O. Pearce 43*baba6a3cSShawn O. Pearce 44*baba6a3cSShawn O. Pearce 45*baba6a3cSShawn O. PearceURL=git://repo.or.cz/jgit.git 46*baba6a3cSShawn O. PearcePRE=3a2dd9921c8a08740a9e02c421469e5b1a9e47cb 47*baba6a3cSShawn O. PearcePOST=1a6964c8274c50f0253db75f010d78ef0e739343 48*baba6a3cSShawn O. Pearce 49*baba6a3cSShawn O. PearceGIT_DIR=$(git rev-parse --git-dir) && 50*baba6a3cSShawn O. Pearcegrafts="$GIT_DIR/info/grafts" && 51*baba6a3cSShawn O. Pearce 52*baba6a3cSShawn O. Pearceif grep $PRE "$grafts" >/dev/null 2>/dev/null 53*baba6a3cSShawn O. Pearcethen 54*baba6a3cSShawn O. Pearce echo 'Graft already installed; doing nothing.' >&2 55*baba6a3cSShawn O. Pearceelse 56*baba6a3cSShawn O. Pearce git remote add old-jgit "$URL" && 57*baba6a3cSShawn O. Pearce git fetch old-jgit && 58*baba6a3cSShawn O. Pearce echo $POST $PRE >>"$GIT_DIR/info/grafts" && 59*baba6a3cSShawn O. Pearce echo 'Graft installed.' >&2 60*baba6a3cSShawn O. Pearcefi 61