- my $v = $ctx->{treeish} = $pfx.$ctx->{snap_ver};
- return $ctx->{env}->{'pi-httpd.async'} ?
- async_check($ctx, $v, \&ver_check, $ctx) :
- $ctx->{git}->check_async($v, \&ver_check, $ctx);
+ } else { # found, done:
+ $ctx->{etag} = $oid;
+ my @cfg;
+ if (my $cmd = $FMT_CFG{$ctx->{snap_fmt}}) {
+ @cfg = ('-c', "tar.$ctx->{snap_fmt}.command=$cmd");
+ }
+ my $qsp = PublicInbox::Qspawn->new(['git', @cfg,
+ "--git-dir=$ctx->{git}->{git_dir}", 'archive',
+ "--prefix=$ctx->{snap_pfx}/",
+ "--format=$ctx->{snap_fmt}", $treeish]);
+ $qsp->psgi_return($ctx->{env}, undef, \&archive_hdr, $ctx);