]> Sergey Matveev's repositories - public-inbox.git/commitdiff
import: only pass Inbox object to SearchIdx->new
authorEric Wong <e@80x24.org>
Fri, 15 Nov 2019 09:50:40 +0000 (09:50 +0000)
committerEric Wong <e@80x24.org>
Sat, 16 Nov 2019 11:05:23 +0000 (11:05 +0000)
SearchIdx->new no longer accepts a GIT_DIR path as its argument
since commit 585314673236d664729fe3ab2d4fb229d1c0f2d5
("searchidx: require PublicInbox::Inbox (or InboxWritable) ref")

lib/PublicInbox/Import.pm

index e1f48771bd629c6dfe37b15b19138681b5bd1b2a..cb25215d15c39665a9b61895ebed8f98618eba77 100644 (file)
@@ -179,9 +179,9 @@ sub _update_git_info ($$) {
                run_die([@cmd, qw(read-tree -m -v -i), $self->{ref}], $env);
        }
        run_die([@cmd, 'update-server-info'], undef);
-       ($self->{path_type} eq '2/38') and eval {
+       my $ibx = $self->{-inbox};
+       ($ibx && $self->{path_type} eq '2/38') and eval {
                require PublicInbox::SearchIdx;
-               my $ibx = $self->{-inbox} || $git_dir;
                my $s = PublicInbox::SearchIdx->new($ibx);
                $s->index_sync({ ref => $self->{ref} });
        };