about summary refs log tree commit homepage
path: root/lib/PublicInbox/GitAsyncCat.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/GitAsyncCat.pm')
-rw-r--r--lib/PublicInbox/GitAsyncCat.pm9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/PublicInbox/GitAsyncCat.pm b/lib/PublicInbox/GitAsyncCat.pm
index 6dda7340..49a3c602 100644
--- a/lib/PublicInbox/GitAsyncCat.pm
+++ b/lib/PublicInbox/GitAsyncCat.pm
@@ -78,6 +78,7 @@ sub async_check ($$$$) {
         my ($ibx, $oidish, $cb, $arg) = @_; # $ibx may be $ctx
         my $git = $ibx->{git} // $ibx->git;
         $git->check_async($oidish, $cb, $arg);
+        return watch_cat($git) if $git->{-bc}; # --batch-command
         $git->{async_chk} //= do {
                 my $self = bless { git => $git }, 'PublicInbox::GitAsyncCheck';
                 $git->{in_c}->blocking(0);
@@ -97,12 +98,8 @@ sub ibx_async_prefetch {
                         $oid .= " $git->{git_dir}\n";
                         return $GCF2C->gcf2_async(\$oid, $cb, $arg); # true
                 }
-        } elsif ($git->{async_cat} && (my $inflight = $git->{inflight})) {
-                if (!@$inflight) {
-                        print { $git->{out} } $oid, "\n" or
-                                                $git->fail("write error: $!");
-                        return push(@$inflight, $oid, $cb, $arg);
-                }
+        } elsif ($git->{async_cat}) {
+                return $git->async_prefetch($oid, $cb, $arg);
         }
         undef;
 }