From: Ian Jackson Date: Sat, 20 Jun 2015 15:08:46 +0000 (+0100) Subject: Infra: dgit-ssh-dispatch: Break out serve_up (nfc) X-Git-Tag: debian/0.30~82 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=bf8dac2155172c0c33b7e764571a3a3985abf8c3;hp=520d2b03770aeb7be9b63fbdddb9ad896d535732 Infra: dgit-ssh-dispatch: Break out serve_up (nfc) --- diff --git a/infra/dgit-ssh-dispatch b/infra/dgit-ssh-dispatch index f29515f5..e90687cb 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 ($_)"; }