]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LeiToMail.pm
lei: All Local Externals: bare git dir for alternates
[public-inbox.git] / lib / PublicInbox / LeiToMail.pm
index 5cea73e19e78f2bd14f98f491daaa4401825dcb6..7e82164631b963157cb53f9bb3d983fad7506c16 100644 (file)
@@ -11,7 +11,6 @@ use PublicInbox::Lock;
 use PublicInbox::ProcessPipe;
 use PublicInbox::Spawn qw(which spawn popen_rd);
 use PublicInbox::LeiDedupe;
-use PublicInbox::Git;
 use PublicInbox::GitAsyncCat;
 use PublicInbox::PktOp qw(pkt_do);
 use Symbol qw(gensym);
@@ -637,23 +636,20 @@ sub poke_dst {
        my ($self) = @_;
        if ($self->{base_type} eq 'maildir') {
                my $t = time + 1;
-               utime($t, $t, "$self->{dst}/cur");
+               utime($t, $t, $self->{dst} . 'cur');
        }
 }
 
 sub write_mail { # via ->wq_io_do
-       my ($self, $git_dir, $smsg) = @_;
-       my $git = $self->{"$$\0$git_dir"} //= PublicInbox::Git->new($git_dir);
-       git_async_cat($git, $smsg->{blob}, \&git_to_mail,
+       my ($self, $smsg) = @_;
+       git_async_cat($self->{lei}->{ale}->git, $smsg->{blob}, \&git_to_mail,
                                [$self->{wcb}, $smsg]);
 }
 
 sub wq_atexit_child {
        my ($self) = @_;
        delete $self->{wcb};
-       for my $git (delete @$self{grep(/\A$$\0/, keys %$self)}) {
-               $git->async_wait_all;
-       }
+       $self->{lei}->{ale}->git->async_wait_all;
        $SIG{__WARN__} = 'DEFAULT';
 }