}
$self->{rbuf} = $rbuf if $$rbuf ne '';
splice(@$inflight, 0, 3); # don't retry $cb on ->fail
- if ($info) {
- eval { $cb->($oid, $type, $size, $arg, $self) };
- async_err($self, $req, $oid, $@, 'check') if $@;
- } else {
- eval { $cb->($bref, $oid, $type, $size, $arg) };
- async_err($self, $req, $oid, $@, 'cat') if $@;
- }
+ eval { $cb->($bref, $oid, $type, $size, $arg) };
+ async_err($self, $req, $oid, $@, $info ? 'check' : 'cat') if $@;
}
sub cat_async_wait ($) {
}
$self->{rbuf_c} = $rbuf if $$rbuf ne '';
splice(@$inflight_c, 0, 3); # don't retry $cb on ->fail
- eval { $cb->($hex, $type, $size, $arg, $self) };
+ eval { $cb->(undef, $hex, $type, $size, $arg) };
async_err($self, $req, $hex, $@, 'check') if $@;
}
}
sub _check_cb { # check_async callback
- my ($hex, $type, $size, $result) = @_;
+ my (undef, $hex, $type, $size, $result) = @_;
@$result = ($hex, $type, $size);
}
}
sub ver_check { # git->check_async callback
- my ($oid, $type, $size, $ctx) = @_;
+ my (undef, $oid, $type, $size, $ctx) = @_;
return if defined $ctx->{etag};
my $treeish = shift @{$ctx->{-try}} // die 'BUG: no {-try}';
if ($type eq 'missing') {
}
sub tree_show { # git check_async callback
- my ($oid, $type, $size, $ctx) = @_;
+ my (undef, $oid, $type, $size, $ctx) = @_;
return find_missing($ctx) if $type eq 'missing';
my $res = [ $ctx->{git}, $oid, $type, $size ];
}
sub check_size { # check_async cb for -index --max-size=...
- my ($oid, $type, $size, $arg, $git) = @_;
- (($type // '') eq 'blob') or die "E: bad $oid in $git->{git_dir}";
+ my (undef, $oid, $type, $size, $arg) = @_;
+ ($type // '') eq 'blob' or die "E: bad $oid in $arg->{git}->{git_dir}";
if ($size <= $arg->{max_size}) {
- $git->cat_async($oid, $arg->{index_oid}, $arg);
+ $arg->{git}->cat_async($oid, $arg->{index_oid}, $arg);
} else {
warn "W: skipping $oid ($size > $arg->{max_size})\n";
}
$arg->{autime} = $at;
$arg->{cotime} = $ct;
if ($sync->{max_size}) {
+ $arg->{git} = $git;
$git->check_async($oid, \&check_size, $arg);
} else {
$git->cat_async($oid, \&index_both, $arg);