From 13ed8aebfc43bd99571d589743333f36bff5567f Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 30 May 2019 03:59:38 +0000 Subject: v2writable: split off unindex_range mapping It'll make it easier to detect if we have anything to unindex and run git-log on, at all. --- lib/PublicInbox/V2Writable.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm index 6b011712..df8cfb45 100644 --- a/lib/PublicInbox/V2Writable.pm +++ b/lib/PublicInbox/V2Writable.pm @@ -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; -- cgit v1.2.3-24-ge0c7