2010-06-01 12:57:33 +02:00
|
|
|
#!/bin/sh
|
2010-04-24 19:30:38 +02:00
|
|
|
|
|
|
|
from=$1
|
|
|
|
to=$2
|
|
|
|
|
|
|
|
. $(dirname $0)/adc.common-functions
|
|
|
|
|
|
|
|
get_rights_and_owner $from
|
2010-06-01 12:57:33 +02:00
|
|
|
[ -z "$perm_read" ] && die "no read permissions on $from"
|
2010-04-24 19:30:38 +02:00
|
|
|
|
|
|
|
get_rights_and_owner $to
|
2010-06-01 12:57:33 +02:00
|
|
|
[ -z "$perm_create" ] && die "no create permissions on $to"
|
2010-04-24 19:30:38 +02:00
|
|
|
|
2010-06-12 12:32:07 +02:00
|
|
|
# clone $from to $to
|
|
|
|
git clone --bare -l $GL_REPO_BASE_ABS/$from.git $GL_REPO_BASE_ABS/$to.git
|
2010-06-22 13:30:48 +02:00
|
|
|
[ $? -ne 0 ] && exit 1
|
2010-06-12 12:32:07 +02:00
|
|
|
|
|
|
|
# fix up creator, and hooks
|
2010-04-24 19:30:38 +02:00
|
|
|
cd $GL_REPO_BASE_ABS/$to.git
|
2010-06-12 12:32:07 +02:00
|
|
|
echo $GL_USER > gl-creater
|
|
|
|
cp -R $GL_REPO_BASE_ABS/$from.git/hooks/* $GL_REPO_BASE_ABS/$to.git/hooks
|
2010-06-22 13:30:48 +02:00
|
|
|
|
|
|
|
if [ -n "$GL_WILDREPOS_DEFPERMS" ]; then
|
|
|
|
echo "$GL_WILDREPOS_DEFPERMS" > gl-perms
|
|
|
|
fi
|
|
|
|
|