about summary refs log tree commit homepage
path: root/lib/PublicInbox
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-11-22 18:23:52 +0000
committerEric Wong <e@80x24.org>2021-11-22 21:36:50 +0000
commiteee1eb1ed3bbf3264676954bb879ed67376169b6 (patch)
treec59727d08486cc8cdee7781f6df443032a542c19 /lib/PublicInbox
parent03de71b293b52db96a254bad2822f863743f5e7d (diff)
downloadpublic-inbox-eee1eb1ed3bbf3264676954bb879ed67376169b6.tar.gz
This fixes the "Modification of a read-only value attempted at ..."
error in an initial run of t/reindex-time-range.t.  It was
reproducible by running `rm -rf t/data-gen/reindex-time-range.v*'
before `make && prove -bvw t/reindex-time-range.t'.  Thanks to
Jörg Rödel for providing the backtrace which helped find this.

Debugged-by: Jörg Rödel <joro@8bytes.org>
Link: https://public-inbox.org/meta/YZuZEY+WSnm4wlrS@8bytes.org/
Diffstat (limited to 'lib/PublicInbox')
-rw-r--r--lib/PublicInbox/SearchIdx.pm10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm
index 6e2e614c..4e5d7d44 100644
--- a/lib/PublicInbox/SearchIdx.pm
+++ b/lib/PublicInbox/SearchIdx.pm
@@ -896,20 +896,20 @@ sub log2stack ($$$) {
                 push @cmd, "--$k=$v";
         }
         my $fh = $git->popen(@cmd, $range);
-        my ($at, $ct, $stk, $cmt);
-        while (<$fh>) {
+        my ($at, $ct, $stk, $cmt, $l);
+        while (defined($l = <$fh>)) {
                 return if $sync->{quit};
-                if (/\A([0-9]+)-([0-9]+)-($OID)$/o) {
+                if ($l =~ /\A([0-9]+)-([0-9]+)-($OID)$/o) {
                         ($at, $ct, $cmt) = ($1 + 0, $2 + 0, $3);
                         $stk //= PublicInbox::IdxStack->new($cmt);
-                } elsif (/$del/) {
+                } elsif ($l =~ /$del/) {
                         my $oid = $1;
                         if ($D) { # reindex case
                                 $D->{pack('H*', $oid)}++;
                         } else { # non-reindex case:
                                 $stk->push_rec('d', $at, $ct, $oid, $cmt);
                         }
-                } elsif (/$add/) {
+                } elsif ($l =~ /$add/) {
                         my $oid = $1;
                         if ($D) {
                                 my $oid_bin = pack('H*', $oid);