]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LeiXSearch.pm
lei: All Local Externals: bare git dir for alternates
[public-inbox.git] / lib / PublicInbox / LeiXSearch.pm
index d95a218e0d1878c283d8e8738c7a5c80f7345840..1266b3b3396f9466b5eb26759f7e857baaf7ffb7 100644 (file)
@@ -297,27 +297,7 @@ sub query_remote_mboxrd {
        $lei->{ovv}->ovv_atexit_child($lei);
 }
 
-# called by LeiOverview::each_smsg_cb
-sub git { $_[0]->{git_tmp} // die 'BUG: caller did not set {git_tmp}' }
-
-sub git_tmp ($) {
-       my ($self) = @_;
-       my (%seen, @dirs);
-       my $tmp = File::Temp->newdir("lei_xsearch_git.$$-XXXX", TMPDIR => 1);
-       for my $ibxish (locals($self)) {
-               my $d = File::Spec->canonpath($ibxish->git->{git_dir});
-               $seen{$d} //= push @dirs, "$d/objects\n"
-       }
-       my $git_dir = $tmp->dirname;
-       PublicInbox::Import::init_bare($git_dir);
-       my $f = "$git_dir/objects/info/alternates";
-       open my $alt, '>', $f or die "open($f): $!";
-       print $alt @dirs or die "print $f: $!";
-       close $alt or die "close $f: $!";
-       my $git = PublicInbox::Git->new($git_dir);
-       $git->{-tmp} = $tmp;
-       $git;
-}
+sub git { $_[0]->{git} // die 'BUG: git uninitialized' }
 
 sub xsearch_done_wait { # dwaitpid callback
        my ($arg, $pid) = @_;
@@ -460,11 +440,6 @@ sub do_query {
                # 1031: F_SETPIPE_SZ
                fcntl($lei->{startq}, 1031, 4096) if $^O eq 'linux';
        }
-       if (!$lei->{opt}->{threads} && locals($self)) { # for query_mset
-               # lei->{git_tmp} is set for wq_wait_old so we don't
-               # delete until all lei2mail + lei_xsearch workers are reaped
-               $lei->{git_tmp} = $self->{git_tmp} = git_tmp($self);
-       }
        $self->wq_workers_start('lei_xsearch', undef,
                                $lei->oldset, { lei => $lei });
        my $op = delete $lei->{pkt_op_c};