(perltidy)

This commit is contained in:
Sitaram Chamarty 2012-04-18 06:26:18 +05:30
parent 2cb7d8313e
commit 1c15b4cc2d
6 changed files with 74 additions and 74 deletions

View file

@ -3,6 +3,7 @@ use strict;
use warnings;
my $tid;
BEGIN {
$tid = $ENV{GL_TID} || 0;
delete $ENV{GL_TID};
@ -33,15 +34,15 @@ usage() if not @ARGV or $ARGV[0] eq '-h';
_die "HOSTNAME not set" if not $rc{HOSTNAME};
my ($cmd, $host, $repo) = @ARGV;
my ( $cmd, $host, $repo ) = @ARGV;
usage() if not $repo;
if ($cmd eq 'push') {
valid_slave($host, $repo) if exists $ENV{GL_USER};
if ( $cmd eq 'push' ) {
valid_slave( $host, $repo ) if exists $ENV{GL_USER};
# will die if host not in slaves for repo
trace(1, "TID=$tid host=$host repo=$repo", "gitolite mirror push started");
_chdir($rc{GL_REPO_BASE});
trace( 1, "TID=$tid host=$host repo=$repo", "gitolite mirror push started" );
_chdir( $rc{GL_REPO_BASE} );
_chdir("$repo.git");
my $errors = 0;
@ -50,19 +51,19 @@ if ($cmd eq 'push') {
chomp;
if (/FATAL/) {
$errors++;
gl_log('mirror', $_);
gl_log( 'mirror', $_ );
} else {
trace(1, "mirror: $_");
trace( 1, "mirror: $_" );
}
}
exit $errors;
}
sub valid_slave {
my ($host, $repo) = @_;
my ( $host, $repo ) = @_;
_die "invalid repo '$repo'" unless $repo =~ $REPONAME_PATT;
my $ref = git_config($repo, "^gitolite-options\\.mirror\\.slaves.*");
my $ref = git_config( $repo, "^gitolite-options\\.mirror\\.slaves.*" );
my %list = map { $_ => 1 } map { split } values %$ref;
_die "'$host' not a valid slave for '$repo'" unless $list{$host};