diff options
author | Tony Finch <dot@dotat.at> | 2016-01-21 10:59:05 +0000 |
---|---|---|
committer | Sitaram Chamarty <sitaram@atc.tcs.com> | 2016-01-21 18:25:34 +0530 |
commit | 8de9b8d37eb7a0ad9915f49da9c699d8216a1fb0 (patch) | |
tree | 79e4c87a7b7b4c7619f613f0e9524fffdf0e7916 | |
parent | (minor) make sure <user> was passed in access command (diff) | |
download | gitolite-gentoo-8de9b8d37eb7a0ad9915f49da9c699d8216a1fb0.tar.gz gitolite-gentoo-8de9b8d37eb7a0ad9915f49da9c699d8216a1fb0.tar.bz2 gitolite-gentoo-8de9b8d37eb7a0ad9915f49da9c699d8216a1fb0.zip |
who-pushed: avoid undefined variable warnings before printing usage
-rwxr-xr-x | src/commands/who-pushed | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/commands/who-pushed b/src/commands/who-pushed index fb37607..e59a750 100755 --- a/src/commands/who-pushed +++ b/src/commands/who-pushed @@ -5,6 +5,7 @@ use warnings; use lib $ENV{GL_LIBDIR}; use Gitolite::Easy; +usage() if not @ARGV; usage($ARGV[1]) if $ARGV[1] and $ARGV[1] =~ /^[\w-]+$/ and $ARGV[0] eq '-h'; ( my $logdir = $ENV{GL_LOGFILE} ) =~ s(/[^/]+$)(); @@ -23,7 +24,7 @@ if ($ARGV[0] eq '--tip') { } # the normal who-pushed -usage() if not @ARGV or @ARGV < 2 or $ARGV[0] eq '-h'; +usage() if @ARGV < 2 or $ARGV[0] eq '-h'; usage() if $ARGV[1] !~ /^[0-9a-f]+$/i; my $repo = shift; @@ -121,7 +122,7 @@ sub flush_gl_log { __END__ =for usage -uSAge: ssh git@host who-pushed [--tip] <repo> <SHA> +usage: ssh git@host who-pushed [--tip] <repo> <SHA> Determine who pushed the given commit. The first few hex digits of the SHA should suffice. If the '--tip' option is supplied, it'll only look for the |