]> Sergey Matveev's repositories - public-inbox.git/commitdiff
v2writable: localize unindex-range.$EPOCH to $sync state
authorEric Wong <e@80x24.org>
Tue, 28 May 2019 23:48:49 +0000 (23:48 +0000)
committerEric Wong <e@80x24.org>
Wed, 29 May 2019 08:04:56 +0000 (08:04 +0000)
We don't need to stuff that into $self (V2Writable) which can be
longer-lived than a ->index_sync invocation.

lib/PublicInbox/V2Writable.pm

index eef5576ca6f9e7b6af37ce694b85981e26f20b5a..315404c53f6ce0f46d0d104f46231fe7babd8e28 100644 (file)
@@ -840,7 +840,7 @@ Rewritten history? (in $git->{git_dir})
 reindexing $git->{git_dir} starting at
 $range
 
-               $self->{"unindex-range.$i"} = "$base..$cur";
+               $sync->{"unindex-range.$i"} = "$base..$cur";
        }
        $range;
 }
@@ -983,7 +983,7 @@ sub index_sync {
                -d $git_dir or next; # missing parts are fine
                fill_alternates($self, $i);
                my $git = PublicInbox::Git->new($git_dir);
-               my $unindex = delete $self->{"unindex-range.$i"};
+               my $unindex = delete $sync->{"unindex-range.$i"};
                $self->unindex($opts, $git, $unindex) if $unindex;
                defined(my $range = $sync->{ranges}->[$i]) or next;
                my $fh = $self->{reindex_pipe} = $git->popen(@cmd, $range);