gitolite/contrib/adc/rmrepo
Sitaram Chamarty 07d07cc5f6 rmrepo alternative 2 was too lax
it would have allowed deleting a non-wild repo too!  Fixed.
2010-09-03 09:02:47 +05:30

24 lines
637 B
Bash
Executable file

#!/bin/sh
. $(dirname $0)/adc.common-functions
delete=$1
get_rights_and_owner $delete
# please choose one alternative and delete the other para
# alternative 1 -- only creator can delete
[ "$owner" = "$GL_USER" ] || die "$delete is not yours to delete!"
# alternative 2 -- creator or anyone with W access to admin repo can delete
[ "$owner" = "$GL_USER" ] || {
# but only if it is wild
[ "$owner" = "<gitolite>" ] && die "$delete is not a wild repo"
get_rights_and_owner gitolite-admin
[ -z "$perm_write" ] && die "$delete is not yours to delete and you're not the admin"
}
cd $GL_REPO_BASE_ABS
rm -rf $delete.git