7f8020adc5
- usage() gets a little smarter; it now knows what function it was called from and tries to find a '=for function_name' chunk of data in the script - the various list-* functions now work off a dispatcher in Load.pm - (...and they all use the new usage() magic to print their helps!) - src/gitolite got a lot leaner due to this dispatcher - src/gitolite-shell became a lot more easier to read/flow - rc acquired '{COMMANDS}', which gitolite-shell now refers to - comments in the default rc file changed a bit - rc got a new REMOTE_COMMAND_PATT (in place of ADC_CMD_ARGS_PATT) the rest is perltidy and stuff like that
35 lines
895 B
Perl
Executable file
35 lines
895 B
Perl
Executable file
#!/usr/bin/perl
|
|
use strict;
|
|
use warnings;
|
|
|
|
use FindBin;
|
|
BEGIN { $ENV{GL_BINDIR} = $FindBin::RealBin; }
|
|
|
|
print STDERR "TRACE: glt(", join( ")(", @ARGV ), ")\n";
|
|
|
|
my $cmd = shift or die "need command";
|
|
my $user = shift or die "need user";
|
|
my $rc;
|
|
|
|
$ENV{G3T_USER} = $user;
|
|
if ($cmd eq 'info' ) {
|
|
$ENV{SSH_ORIGINAL_COMMAND} = $cmd;
|
|
exec( "$ENV{GL_BINDIR}/../src/gitolite-shell", $user );
|
|
} elsif ( $cmd eq 'push' ) {
|
|
$rc = system( "git", $cmd, "--receive-pack=$ENV{GL_BINDIR}/gitolite-receive-pack", @ARGV );
|
|
} else {
|
|
$rc = system( "git", $cmd, "--upload-pack=$ENV{GL_BINDIR}/gitolite-upload-pack", @ARGV );
|
|
}
|
|
|
|
if ( $? == -1 ) {
|
|
die "F: failed to execute: $!\n";
|
|
} elsif ( $? & 127 ) {
|
|
printf STDERR "E: child died with signal %d\n", ( $? & 127 );
|
|
exit 1;
|
|
} else {
|
|
printf STDERR "W: child exited with value %d\n", $? >> 8 if $? >> 8;
|
|
exit( $? >> 8 );
|
|
}
|
|
|
|
exit 0;
|