D: allow rm and unlock to be disabled
This commit is contained in:
parent
3513f4a153
commit
b9bbb78278
|
@ -12,6 +12,9 @@
|
||||||
|
|
||||||
# - run a cron job to delete old repos based on age (the TRASH_SUFFIX has a
|
# - run a cron job to delete old repos based on age (the TRASH_SUFFIX has a
|
||||||
# timestamp); your choice how/how often you do that
|
# timestamp); your choice how/how often you do that
|
||||||
|
|
||||||
|
# - you can completely disable the 'rm' command by setting an rc variable
|
||||||
|
# called D_DISABLE_RM to "1".
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
|
@ -67,6 +70,8 @@ owner_or_die() {
|
||||||
if [ "$cmd" = "rm" ]
|
if [ "$cmd" = "rm" ]
|
||||||
then
|
then
|
||||||
|
|
||||||
|
gitolite query-rc -q D_DISABLE_RM && die "sorry, 'unlock' and 'rm' are disabled"
|
||||||
|
|
||||||
owner_or_die
|
owner_or_die
|
||||||
[ -f $repo.git/gl-rm-ok ] || die "'$repo' is locked!"
|
[ -f $repo.git/gl-rm-ok ] || die "'$repo' is locked!"
|
||||||
rm -rf $repo.git
|
rm -rf $repo.git
|
||||||
|
@ -82,6 +87,8 @@ then
|
||||||
elif [ "$cmd" = "unlock" ]
|
elif [ "$cmd" = "unlock" ]
|
||||||
then
|
then
|
||||||
|
|
||||||
|
gitolite query-rc -q D_DISABLE_RM && die "sorry, 'unlock' and 'rm' are disabled"
|
||||||
|
|
||||||
owner_or_die
|
owner_or_die
|
||||||
touch $repo.git/gl-rm-ok
|
touch $repo.git/gl-rm-ok
|
||||||
echo "'$repo' is now unlocked"
|
echo "'$repo' is now unlocked"
|
||||||
|
|
Loading…
Reference in a new issue