delete $self->{inflight};
cleanup($self);
- $self->{inflight} = $inflight;
- batch_prepare($self);
+ batch_prepare($self, $inflight);
my $buf = '';
for (my $i = 0; $i < @$inflight; $i += 3) {
$buf .= "$inflight->[$i]\n";
}
}
-sub batch_prepare ($) {
- my ($self) = @_;
+sub batch_prepare ($$) {
+ my ($self, $inflight) = @_;
check_git_exe();
if ($GIT_VER ge BATCH_CMD_VER) {
_bidi_pipe($self, qw(batch-command in out pid err_c));
} else {
_bidi_pipe($self, qw(batch in out pid));
}
- $self->{inflight} = [];
+ $self->{inflight} = $inflight;
}
sub _cat_file_cb {
my ($self) = @_;
cleanup($self) if $self->alternates_changed;
die 'BUG: already in async' if $self->{inflight};
- batch_prepare($self);
+ batch_prepare($self, []);
}
sub cat_async ($$$;$) {
my $ibx = $self->{ibx};
local $self->{current_info} = "$ibx->{inboxdir}";
$self->{batch_bytes} = $opt->{batch_size} // $BATCH_BYTES;
- $ibx->git->batch_prepare;
+
+ if ($X->{CLOEXEC_UNSET}) {
+ $ibx->git->cat_file($tip);
+ $ibx->git->check($tip);
+ }
my $pr = $opt->{-progress};
my $sync = { reindex => $opt->{reindex}, -opt => $opt, ibx => $ibx };
my $quit = quit_cb($sync);