]> Sergey Matveev's repositories - public-inbox.git/commitdiff
v2writable: split off unindex_range mapping
authorEric Wong <e@80x24.org>
Thu, 30 May 2019 03:59:38 +0000 (03:59 +0000)
committerEric Wong <e@80x24.org>
Thu, 30 May 2019 05:53:32 +0000 (05:53 +0000)
It'll make it easier to detect if we have anything to
unindex and run git-log on, at all.

lib/PublicInbox/V2Writable.pm

index 6b01171271475bdf6f082f25c12f7388d1f7f611..df8cfb45ad86f6042ae02c632fa941c25f295165 100644 (file)
@@ -861,7 +861,7 @@ Rewritten history? (in $git->{git_dir})
 reindexing $git->{git_dir} starting at
 $range
 
-               $sync->{"unindex-range.$i"} = "$base..$cur";
+               $sync->{unindex_range}->{$i} = "$base..$cur";
        }
        $range;
 }
@@ -993,6 +993,7 @@ sub index_sync {
        my $sync = {
                mm_tmp => $self->{mm}->tmp_clone,
                D => {}, # "$mid\0$cid" => $oid
+               unindex_range => {}, # EPOCH => oid_old..oid_new
                reindex => $opt->{reindex},
                -opt => $opt
        };
@@ -1009,7 +1010,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_range = delete $sync->{"unindex-range.$i"};
+               my $unindex_range = delete $sync->{unindex_range}->{$i};
                unindex($self, $sync, $git, $unindex_range) if $unindex_range;
                defined(my $range = $sync->{ranges}->[$i]) or next;
                $pr->("$i.git indexing $range\n") if $pr;