chiark / gitweb /
dgit-repos-server: wip tests
[dgit.git] / dgit-repos-server
index 5055de63bc44b939dbd44e4bc683056507f9b4c7..cbbfe1ea7ccd297b7bc3835b48e9acc27aee611b 100644 (file)
@@ -1,10 +1,10 @@
 #!/usr/bin/perl -w
-# dgit-repos-push-receiver
+# dgit-repos-server
 #
 # usages:
-#  .../dgit-repos-push-receiver SUITES KEYRING-AUTH-SPEC DGIT-REPOS-DIR --ssh
+#  .../dgit-repos-server SUITES KEYRING-AUTH-SPEC DGIT-REPOS-DIR --ssh
 # internal usage:
-#  .../dgit-repos-push-receiver --pre-receive-hook PACKAGE
+#  .../dgit-repos-server --pre-receive-hook PACKAGE
 #
 # Invoked as the ssh restricted command
 #
@@ -393,6 +393,16 @@ sub stunthook () {
     onwardpush();
 }
 
+#----- git-upload-pack -----
+
+sub fixmissing__git_upload_pack () {
+    $destrepo = "$dgitrepos/_empty";
+}
+
+sub main__git_upload_pack () {
+    runcmd qw(git upload-pack), $destdir;
+}
+
 #----- arg parsing and main program -----
 
 sub argval () {
@@ -427,11 +437,11 @@ sub parseargsdispatch () {
     my $cmd = $ENV{'SSH_ORIGINAL_COMMAND'};
     $cmd =~ m{
        ^
-       (?:\S*/)?
-       ([-0-9a-z]+)
+       (?: \S* / )?
+       ( [-0-9a-z]+ )
        \s+
-       (?:\S*/)?
-       ($package_re)\.git
+       (?: \S* / )?
+       ($package_re) \.git
        $
     }ox 
     or reject "command string not understood";