]> Sergey Matveev's repositories - public-inbox.git/commitdiff
extsearchidx: remove needless SHA-1 check
authorEric Wong <e@80x24.org>
Mon, 7 Dec 2020 07:40:51 +0000 (07:40 +0000)
committerEric Wong <e@80x24.org>
Tue, 8 Dec 2020 07:19:30 +0000 (07:19 +0000)
There is no need to verify checksums of data already stored in
git.  Doing this ourselves also limits flexibility in moving to
other hashes.

lib/PublicInbox/ExtSearchIdx.pm

index 4de47b5824af7a95b4ff84f5d6c97ce0df63e53b..819c7903e108b1c6c1b64d31b1e075fa1f5ac1d4 100644 (file)
@@ -91,14 +91,6 @@ sub attach_config {
        $cfg->each_inbox(\&_ibx_attach, $self);
 }
 
-sub git_blob_digest ($) {
-       my ($bref) = @_;
-       my $dig = Digest::SHA->new(1); # XXX SHA256 later
-       $dig->add('blob '.length($$bref)."\0");
-       $dig->add($$bref);
-       $dig;
-}
-
 sub is_bad_blob ($$$$) {
        my ($oid, $type, $size, $expect_oid) = @_;
        if ($type ne 'blob') {
@@ -245,10 +237,6 @@ sub cur_ibx_xnum ($$) {
        my ($req, $bref) = @_;
        my $ibx = $req->{ibx} or die 'BUG: current {ibx} missing';
 
-       # XXX overkill?
-       git_blob_digest($bref)->hexdigest eq $req->{oid} or die
-               "BUG: blob mismatch $req->{oid}";
-
        $req->{eml} = PublicInbox::Eml->new($bref);
        $req->{chash} = content_hash($req->{eml});
        $req->{mids} = mids($req->{eml});