inbox => $ibx,
path_type => '2/38', # or 'v2'
ssoma_lock => 1, # disable for v2
+ bytes_added => 0,
}, $class
}
warn "bogus TZ offset: $zone, ignoring and assuming +0000\n";
$zone = '+0000';
}
- $ts ||= time;
+ $ts = time unless defined $ts;
$ts = 0 if $ts < 0; # git uses unsigned times
"$ts $zone";
}
my $blob = $self->{mark}++;
my $str = $mime->as_string;
- print $w "blob\nmark :$blob\ndata ", length($str), "\n" or wfail;
+ my $n = length($str);
+ $self->{bytes_added} += $n;
+ print $w "blob\nmark :$blob\ndata ", $n, "\n" or wfail;
print $w $str, "\n" or wfail;
$str = undef;
# v2: we need this for Xapian
if ($self->{want_object_id}) {
chomp($self->{last_object_id} = $self->get_mark(":$blob"));
+ $self->{last_object_size} = $n;
}
my $ref = $self->{ref};
$self->{tip} = ":$commit";
}
-sub run_die ($$) {
+sub run_die ($;$) {
my ($cmd, $env) = @_;
my $pid = spawn($cmd, $env, undef);
defined $pid or die "spawning ".join(' ', @$cmd)." failed: $!";
}
if ($nchg) {
run_die([@cmd, 'update-server-info'], undef);
- eval {
+ ($self->{path_type} eq '2/38') and eval {
require PublicInbox::SearchIdx;
my $inbox = $self->{inbox} || $git_dir;
my $s = PublicInbox::SearchIdx->new($inbox);