about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiStore.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-02-22 06:18:55 +0000
committerEric Wong <e@80x24.org>2021-02-22 10:31:02 +0000
commitdf7e9afebf0c583640773efac01583aa9a1fa2d6 (patch)
tree94da2c04a7951a3132321122168079012ccf02b4 /lib/PublicInbox/LeiStore.pm
parent2ee341027929f716636aa7f03057a961d3a02d1c (diff)
downloadpublic-inbox-df7e9afebf0c583640773efac01583aa9a1fa2d6.tar.gz
Since eidx_init updates ALL.git/objects/info/alternates, we need
to ensure new epochs we create from LeiStore->importer exist
before eidx_init writes alternates.

Reported-by: Kyle Meyer <kyle@kyleam.com>
Link: https://public-inbox.org/meta/8735xou0gq.fsf@kyleam.com/
Diffstat (limited to 'lib/PublicInbox/LeiStore.pm')
-rw-r--r--lib/PublicInbox/LeiStore.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/LeiStore.pm b/lib/PublicInbox/LeiStore.pm
index 546d500b..77601828 100644
--- a/lib/PublicInbox/LeiStore.pm
+++ b/lib/PublicInbox/LeiStore.pm
@@ -192,10 +192,10 @@ sub maildir_keywords {
 
 sub add_eml {
         my ($self, $eml, @kw) = @_;
-        my $eidx = eidx_init($self);
+        my $im = $self->importer; # may create new epoch
+        my $eidx = eidx_init($self); # writes ALL.git/objects/info/alternates
         my $oidx = $eidx->{oidx};
         my $smsg = bless { -oidx => $oidx }, 'PublicInbox::Smsg';
-        my $im = $self->importer;
         $im->add($eml, undef, $smsg) or return; # duplicate returns undef
 
         local $self->{current_info} = $smsg->{blob};