for my $o (@overs) {
my ($id, $prev);
while (my $cur = $o->next_by_mid($mid, \$id, \$prev)) {
+ # {bytes} may be '' from old bug
+ $cur->{bytes} = 1 if $cur->{bytes} eq '';
next if $cur->{bytes} == 0 ||
$xoids->{$cur->{blob}};
$git->cat_async($cur->{blob}, \&_cmp_1st,
"W: $oid is $type (!= blob)");
$size or return $self->{lei}->child_error(0,"E: $oid is empty");
$smsg->{blob} eq $oid or die "BUG: expected=$smsg->{blob}";
+ $smsg->{bytes} ||= $size;
$self->{wcb}->($bref, $smsg);
};
$self->{lei}->fail("$@ (oid=$oid)") if $@;
use PublicInbox::Smsg qw(subject_normalized);
use Compress::Zlib qw(compress);
use Carp qw(croak);
+use bytes (); # length
sub dbh_new {
my ($self) = @_;
sub add_overview {
my ($self, $eml, $smsg) = @_;
- $smsg->{lines} = $eml->body_raw =~ tr!\n!\n!;
+ my $raw = $eml->body_raw;
+ $smsg->{lines} = $raw =~ tr!\n!\n!;
+ $smsg->{bytes} //= bytes::length $raw;
+ undef $raw;
my $mids = mids_for_index($eml);
my $refs = $smsg->parse_references($eml, $mids);
$mids->[0] //= do {