Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

D: allow rm and unlock to be disabled

  • Loading branch information...
commit b9bbb78278c12d9468d8c50b61ca27e6d6fa0c5b 1 parent 3513f4a
@sitaramc authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/commands/D
View
7 src/commands/D
@@ -12,6 +12,9 @@
# - 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
+
+# - 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" ]
then
+ gitolite query-rc -q D_DISABLE_RM && die "sorry, 'unlock' and 'rm' are disabled"
+
owner_or_die
[ -f $repo.git/gl-rm-ok ] || die "'$repo' is locked!"
rm -rf $repo.git
@@ -82,6 +87,8 @@ then
elif [ "$cmd" = "unlock" ]
then
+ gitolite query-rc -q D_DISABLE_RM && die "sorry, 'unlock' and 'rm' are disabled"
+
owner_or_die
touch $repo.git/gl-rm-ok
echo "'$repo' is now unlocked"
Please sign in to comment.
Something went wrong with that request. Please try again.