# returns a revision range for git-log(1)
sub log_range ($$$) {
my ($sync, $unit, $tip) = @_;
- my $opt = $sync->{self}->{-opt};
+ my $self = $sync->{self};
+ my $opt = $self->{-opt};
my $pr = $opt->{-progress} if (($opt->{verbose} || 0) > 1);
my $i = $unit->{epoch};
- my $cur = $sync->{ranges}->[$i] or do {
+ my $cur = $self->{ranges}->[$i] or do {
$pr->("$i.git indexing all of $tip\n") if $pr;
return $tip; # all of it
};
# fast equality check to avoid (v)fork+execve overhead
if ($cur eq $tip) {
- $sync->{ranges}->[$i] = undef;
+ $self->{ranges}->[$i] = undef;
return;
}
my $n = $git->qx(qw(rev-list --count), $range);
chomp($n);
if ($n == 0) {
- $sync->{ranges}->[$i] = undef;
+ $self->{ranges}->[$i] = undef;
$pr->("$i.git has nothing new\n") if $pr;
return; # nothing to do
}
sub sync_prepare ($$) {
my ($self, $sync) = @_;
- $sync->{ranges} = sync_ranges($self, $sync);
+ $self->{ranges} = sync_ranges($self, $sync);
my $pr = $self->{-opt}->{-progress};
my $regen_max = 0;
my $head = $self->{ibx}->{ref_head} || 'HEAD';
local $self->{reindex} = $opt->{reindex};
local $self->{mm_tmp};
local $self->{todo}; # sync_prepare
+ local $self->{ranges};
local $self->{unindexed};
my $sync = { self => $self, ibx => $self->{ibx} };
my $quit = PublicInbox::SearchIdx::quit_cb $self;