summaryrefslogtreecommitdiff
path: root/infra/dgit-ssh-dispatch
diff options
context:
space:
mode:
Diffstat (limited to 'infra/dgit-ssh-dispatch')
-rwxr-xr-xinfra/dgit-ssh-dispatch9
1 files changed, 7 insertions, 2 deletions
diff --git a/infra/dgit-ssh-dispatch b/infra/dgit-ssh-dispatch
index f29515f..e90687c 100755
--- a/infra/dgit-ssh-dispatch
+++ b/infra/dgit-ssh-dispatch
@@ -111,6 +111,12 @@ sub hasrepo () {
}
}
+sub serve_up ($) {
+ my ($repo) = @_;
+ exec qw(git upload-pack --strict --timeout=1000), $repo;
+ die "exec git: $!";
+}
+
sub dispatch () {
local ($_) = $ENV{'SSH_ORIGINAL_COMMAND'};
@@ -129,8 +135,7 @@ sub dispatch () {
die "exec $s: $!";
} elsif ($cmd eq 'upload-pack') {
$repo='$repos/_empty' unless hasrepo;
- exec qw(git upload-pack --strict --timeout=1000), $repo;
- die "exec git: $!";
+ serve_up $repo;
} else {
die "unsupported git operation $cmd ($_)";
}