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
|
|
|
|
2010-08-20 17:25:23 +02:00
|
|
|
# fix up creator, gitweb owner, 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
|
2010-08-20 17:25:23 +02:00
|
|
|
git config gitweb.owner "$GL_USER"
|
|
|
|
( cd $HOME;perl -e 'do ".gitolite.rc"; print $GL_WILDREPOS_DEFPERMS' ) |
|
|
|
|
SSH_ORIGINAL_COMMAND="setperms $to" $GL_BINDIR/gl-auth-command $GL_USER
|
2010-06-12 12:32:07 +02:00
|
|
|
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
|
|
|
|
|