5b3dcb3757
- get_rights_and_owner normalises its arg1 by stripping .git if supplied, then sets the variable "repo" to the result as a side effect - new "help" adc with some default text but main purpose is to allow site local help text - other adc's refer to 'help' adc when appropriate - 'undelete' renamed to 'restore'; that's what the KDE "trashcan" program calls that operation - minor typo in sample script in documentation - main adc doc points to contrib/adc/repo-deletion.README now
31 lines
1 KiB
Bash
Executable file
31 lines
1 KiB
Bash
Executable file
#!/bin/sh
|
|
|
|
. $(dirname $0)/adc.common-functions
|
|
|
|
# get_rights_and_owner now also sets $repo; see comments in common functions
|
|
get_rights_and_owner $1; from=$repo
|
|
[ -z "$perm_read" ] && die "no read permissions on $from"
|
|
|
|
get_rights_and_owner $2; to=$repo
|
|
[ -z "$perm_create" ] && die "no create permissions on $to"
|
|
|
|
# clone $from to $to
|
|
git clone --bare -l $GL_REPO_BASE_ABS/$from.git $GL_REPO_BASE_ABS/$to.git
|
|
[ $? -ne 0 ] && exit 1
|
|
|
|
# fix up creator, gitweb owner, and hooks
|
|
cd $GL_REPO_BASE_ABS/$to.git
|
|
echo $GL_USER > gl-creater
|
|
git config gitweb.owner "$GL_USER"
|
|
( cd $HOME;perl -le 'do ".gitolite.rc"; print $GL_WILDREPOS_DEFPERMS' ) |
|
|
SSH_ORIGINAL_COMMAND="setperms $to" $GL_BINDIR/gl-auth-command $GL_USER
|
|
cp -R $GL_REPO_BASE_ABS/$from.git/hooks/* $GL_REPO_BASE_ABS/$to.git/hooks
|
|
|
|
if [ -n "$GL_WILDREPOS_DEFPERMS" ]; then
|
|
echo "$GL_WILDREPOS_DEFPERMS" > gl-perms
|
|
fi
|
|
|
|
# run gitolite's post-init hook if you can (hook code expects GL_REPO to be set)
|
|
export GL_REPO; GL_REPO="$to"
|
|
[ -x hooks/gl-post-init ] && hooks/gl-post-init
|