about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiXSearch.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-09-21 07:41:52 +0000
committerEric Wong <e@80x24.org>2021-09-21 19:18:35 +0000
commita1cd0fccd40f1c2f0073c1e75ed3e8a26271dcd0 (patch)
tree8ce0b5c6d85c942eb69c94e956623d0c732aa4a2 /lib/PublicInbox/LeiXSearch.pm
parent387f0e693f9e22a7698927bb40dab0742738e8a6 (diff)
downloadpublic-inbox-a1cd0fccd40f1c2f0073c1e75ed3e8a26271dcd0.tar.gz
If lcat-ing multiple argument types (blobs vs folders),
maintain the original order of the arguments instead of
dumping all blobs before folder contents.
Diffstat (limited to 'lib/PublicInbox/LeiXSearch.pm')
-rw-r--r--lib/PublicInbox/LeiXSearch.pm16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/PublicInbox/LeiXSearch.pm b/lib/PublicInbox/LeiXSearch.pm
index 756183a9..3ce8f32d 100644
--- a/lib/PublicInbox/LeiXSearch.pm
+++ b/lib/PublicInbox/LeiXSearch.pm
@@ -570,7 +570,7 @@ sub do_query {
         @$end = ();
         $self->{opt_threads} = $lei->{opt}->{threads};
         $self->{opt_sort} = $lei->{opt}->{'sort'};
-        $self->{-do_lcat} = $lei->{lcat_blob} // $lei->{lcat_fid};
+        $self->{-do_lcat} = !!(delete $lei->{lcat_todo});
         if ($l2m) {
                 $l2m->net_merge_all_done unless $lei->{auth};
         } else {
@@ -646,13 +646,13 @@ sub lcat_dump { # via wq_io_do
                         $git->cat_async($smsg->{blob}, \&_lcat2smsg, $smsg);
                 };
         }
-        for my $oid (@{$lei->{lcat_blob} // []}) {
-                $each_smsg->({ blob => $oid, pct => 100 });
-        }
-        if (my $fids = delete $lei->{lcat_fid}) {
-                my $lms = $lei->{lse}->lms;
-                for my $fid (@$fids) {
-                        $lms->each_src({fid => $fid}, \&_lcat_i, $each_smsg);
+        my $lms;
+        for my $ent (@{$lei->{lcat_todo}}) {
+                if (ref $ent eq 'HASH') { # { fid => $fid ,.. }
+                        $lms //= $lei->{lse}->lms;
+                        $lms->each_src($ent, \&_lcat_i, $each_smsg);
+                } else { # oidhex
+                        $each_smsg->({ blob => $ent, pct => 100 });
                 }
         }
         $git->async_wait_all;