blob: fd4425ac4ee8687e0e88bfc89c1dfd4f0cc342a9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#!/bin/sh
if test $# -lt 3; then
echo "Usage: $0 <tree> <tag> <dir>"
exit 1
fi
TREE=$1
TAG=$2
DIR=$3
set -e
if test \! -d $DIR-remote; then
rm -rf $DIR-remote $DIR-remote.tmp
mkdir -p $DIR-remote.tmp; rmdir $DIR-remote.tmp
$GIT clone $TREE $DIR-remote.tmp
if test "$TAG" ; then
cd $DIR-remote.tmp
$GIT branch -D dummy >/dev/null 2>&1 ||:
$GIT checkout -b dummy $TAG
cd -
fi
mv $DIR-remote.tmp $DIR-remote
fi
rm -f $DIR
ln -sf $(basename $DIR-remote) $DIR
|