From 4e6710183bc331020a406077a1873f2713973f07 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 12 Aug 2016 22:08:50 +0000 Subject: watch: respect altid for incremental watch changes 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. --- lib/PublicInbox/Import.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/Import.pm') 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} }); }; } -- cgit v1.2.3-24-ge0c7