aboutsummaryrefslogtreecommitdiff
path: root/t/glt
diff options
context:
space:
mode:
authorSitaram Chamarty <sitaram@atc.tcs.com>2012-03-08 13:30:13 +0530
committerSitaram Chamarty <sitaram@atc.tcs.com>2012-03-24 10:30:37 +0530
commit60e190215e5e6defe593df8b3eb2e7d3bd409f46 (patch)
tree593a96ec2c5f361c33b0417865ddadc5363ebff9 /t/glt
parentempty (diff)
downloadgitolite-gentoo-60e190215e5e6defe593df8b3eb2e7d3bd409f46.tar.gz
gitolite-gentoo-60e190215e5e6defe593df8b3eb2e7d3bd409f46.tar.bz2
gitolite-gentoo-60e190215e5e6defe593df8b3eb2e7d3bd409f46.zip
very basic, usable, first cut done
- sausage making hidden - lots of important features missing
Diffstat (limited to 't/glt')
-rwxr-xr-xt/glt28
1 files changed, 28 insertions, 0 deletions
diff --git a/t/glt b/t/glt
new file mode 100755
index 0000000..b5704f5
--- /dev/null
+++ b/t/glt
@@ -0,0 +1,28 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+
+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 'push' ) {
+ $rc = system( "git", $cmd, "--receive-pack=$ENV{HOME}/bin/gitolite-receive-pack", @ARGV );
+} else {
+ $rc = system( "git", $cmd, "--upload-pack=$ENV{HOME}/bin/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;