about summary refs log tree commit homepage
path: root/lib/PublicInbox/Import.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-08-12 22:08:50 +0000
committerEric Wong <e@80x24.org>2016-08-12 22:08:50 +0000
commit4e6710183bc331020a406077a1873f2713973f07 (patch)
tree0b1a05c26fbb15ad2c1cf5634f6c2e5faac9c58e /lib/PublicInbox/Import.pm
parent50c1b933afec4937ebc99e1d372cef2dc6b295c2 (diff)
downloadpublic-inbox-4e6710183bc331020a406077a1873f2713973f07.tar.gz
We need to pass the Inbox object to SearchIdx to get altid
mappings properly for incremental imports.

TODO: use the Inbox object in more places where it makes sense
to do so.
Diffstat (limited to 'lib/PublicInbox/Import.pm')
-rw-r--r--lib/PublicInbox/Import.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/PublicInbox/Import.pm b/lib/PublicInbox/Import.pm
index ff5b3f38..9555d27c 100644
--- a/lib/PublicInbox/Import.pm
+++ b/lib/PublicInbox/Import.pm
@@ -12,12 +12,13 @@ use PublicInbox::Spawn qw(spawn);
 use PublicInbox::MID qw(mid_mime mid2path);
 
 sub new {
-        my ($class, $git, $name, $email) = @_;
+        my ($class, $git, $name, $email, $inbox) = @_;
         bless {
                 git => $git,
                 ident => "$name <$email>",
                 mark => 1,
                 ref => 'refs/heads/master',
+                inbox => $inbox,
         }, $class
 }
 
@@ -237,7 +238,8 @@ sub done {
 
                 eval {
                         require PublicInbox::SearchIdx;
-                        my $s = PublicInbox::SearchIdx->new($git_dir);
+                        my $inbox = $self->{inbox} || $git_dir;
+                        my $s = PublicInbox::SearchIdx->new($inbox);
                         $s->index_sync({ ref => $self->{ref} });
                 };
         }