diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2015-06-20 16:08:46 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2015-06-20 16:08:46 +0100 |
commit | bf8dac2155172c0c33b7e764571a3a3985abf8c3 (patch) | |
tree | 0598e34f616fc625a8724ff8917a93a3a8897566 | |
parent | 520d2b03770aeb7be9b63fbdddb9ad896d535732 (diff) |
Infra: dgit-ssh-dispatch: Break out serve_up (nfc)
-rwxr-xr-x | infra/dgit-ssh-dispatch | 9 |
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 ($_)"; } |