diff --git a/src/Gitolite/Rc.pm b/src/Gitolite/Rc.pm index 06420d9ea..25d5cb8e9 100644 --- a/src/Gitolite/Rc.pm +++ b/src/Gitolite/Rc.pm @@ -94,7 +94,7 @@ $ENV{PATH} = "$ENV{GL_BINDIR}:$ENV{PATH}"; } # these two are meant to help externally written commands (see -# src/commands/writes for an example) +# src/commands/writable for an example) $ENV{GL_REPO_BASE} = $rc{GL_REPO_BASE}; $ENV{GL_ADMIN_BASE} = $rc{GL_ADMIN_BASE}; @@ -282,7 +282,7 @@ __DATA__ 'info' => 1, 'desc' => 1, 'perms' => 1, - 'writes' => 1, + 'writable' => 1, }, # comment out or uncomment as needed diff --git a/src/commands/writes b/src/commands/writable similarity index 92% rename from src/commands/writes rename to src/commands/writable index 0dc5d6aa6..f87e37052 100755 --- a/src/commands/writes +++ b/src/commands/writable @@ -6,7 +6,7 @@ use lib $ENV{GL_BINDIR}; use Gitolite::Easy; =for usage -Usage: gitolite writes on|off |@all +Usage: gitolite writable |@all on|off 'on' enables, 'off' disables, writes (pushes) to the named repo or all repos. @@ -16,11 +16,10 @@ from STDIN; this allows longer messages. =cut usage() if not @ARGV or @ARGV < 2 or $ARGV[0] eq '-h'; - -usage() if $ARGV[0] ne 'on' and $ARGV[0] ne 'off'; -my $on = ( shift eq 'on' ); +usage() if $ARGV[1] ne 'on' and $ARGV[1] ne 'off'; my $repo = shift; +my $on = ( shift eq 'on' ); if ( $repo eq '@all' ) { die "you are not authorized\n" if $ENV{GL_USER} and not is_admin(); diff --git a/t/glt b/t/glt index 3b3daf84a..b335cc070 100755 --- a/t/glt +++ b/t/glt @@ -14,7 +14,7 @@ my %extcmds = ( info => 1, desc => 1, perms => 1, - writes => 1, + writable => 1, ); $ENV{G3T_USER} = $user; diff --git a/t/writes.t b/t/writable.t similarity index 92% rename from t/writes.t rename to t/writable.t index 08a8143ef..25d93ecb9 100755 --- a/t/writes.t +++ b/t/writable.t @@ -8,7 +8,7 @@ use Gitolite::Test; use Cwd; my $workdir = getcwd(); -# 'gitolite writes' command +# 'gitolite writable' command # ---------------------------------------------------------------------- my $sf = ".gitolite.down"; @@ -48,7 +48,7 @@ try " PUSH u2 master; ok; # disable site with some message - gitolite writes off \@all testing site-wide disable; ok + gitolite writable \@all off testing site-wide disable; ok # try push foo and see fail + message cd ../foo; ok @@ -67,7 +67,7 @@ try " cd u4; ok # enable site - gitolite writes on \@all; ok + gitolite writable \@all on; ok # try same 3 again @@ -88,7 +88,7 @@ try " cd u6; ok # disable just foo - gitolite writes off foo foo down + gitolite writable foo off foo down # try push foo and see the message cd ../foo; ok @@ -101,8 +101,8 @@ try " PUSH u2; ok; /master -> master/ # enable foo, disable bar/u2 - gitolite writes on foo - gitolite writes off bar/u2 the bar is closed + gitolite writable foo on + gitolite writable bar/u2 off the bar is closed # try both cd ../foo; ok