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
|
|
|
|
|
|
|
|
# we cannot just say "cd $GL_REPO_BASE_ABS; git clone $from.git $to.git". That
|
|
|
|
# won't set up the hooks or the gl-creater file that gitolite needs. So we now
|
|
|
|
# have a new "git-init" command!
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
# let gitolite create the repo first
|
|
|
|
SSH_ORIGINAL_COMMAND="git-init '$to'" $GL_BINDIR/gl-auth-command $GL_USER
|
|
|
|
# then copy the refs from $from
|
|
|
|
cd $GL_REPO_BASE_ABS/$to.git
|
|
|
|
git fetch $GL_REPO_BASE_ABS/$from.git refs/*:refs/*
|