]> Sergey Matveev's repositories - public-inbox.git/commitdiff
xapcmd: set {from} properly for v1 inboxes
authorEric Wong <e@yhbt.net>
Fri, 24 Jul 2020 05:55:59 +0000 (05:55 +0000)
committerEric Wong <e@yhbt.net>
Sat, 25 Jul 2020 20:48:18 +0000 (20:48 +0000)
This was a bug, but I'm not sure where it matters, yet, but it
may matter in the future.

lib/PublicInbox/Xapcmd.pm

index c04f935cdc1b639eb53f176c138e22060d108a4f..4ee3fc79195d5f59e3ff18b29761dd875675fdf6 100644 (file)
@@ -257,8 +257,9 @@ sub run {
        my $reindex; # v1:{ from => $x40 }, v2:{ from => [ $x40, $x40, .. ] } }
 
        if (!$opt->{-coarse_lock}) {
-               $reindex = $opt->{reindex} = {};
-               $reindex->{from} = []; # per-epoch ranges
+               $reindex = $opt->{reindex} = { # per-epoch ranges for v2
+                       from => $ibx->version == 1 ? '' : [],
+               };
                require PublicInbox::SearchIdx;
                PublicInbox::SearchIdx::load_xapian_writable();
        }