]> Sergey Matveev's repositories - public-inbox.git/commitdiff
extsearchidx: ck_existing: set $OID for warning context
authorEric Wong <e@80x24.org>
Tue, 8 Dec 2020 21:21:30 +0000 (21:21 +0000)
committerEric Wong <e@80x24.org>
Wed, 9 Dec 2020 21:13:36 +0000 (21:13 +0000)
The content_hash() hash in the same scope may trigger warnings
for a given blob, so ensure we correctly report the blob where
it happens.

lib/PublicInbox/ExtSearchIdx.pm

index c82d163349a755094193fb5916c617aae76fa0e1..11f7786def257155329ab9f113136b9868f4dd1f 100644 (file)
@@ -222,6 +222,8 @@ sub ck_existing { # git->cat_async callback
        if ($type eq 'missing') {
                _blob_missing($req);
        } elsif (!is_bad_blob($oid, $type, $size, $smsg->{blob})) {
+               my $self = $req->{self} // die 'BUG: {self} missing';
+               local $self->{current_info} = "$self->{current_info} $oid";
                my $cur = PublicInbox::Eml->new($bref);
                if (content_hash($cur) eq $req->{chash}) {
                        push @{$req->{indexed}}, $smsg; # for do_xpost