]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Import.pm
import: cleanup git cat-file processes when ->done
[public-inbox.git] / lib / PublicInbox / Import.pm
index c7a96e1eabcc1214e6cdc61572ba6ed70db64750..250a2db31e979054c94df5a0e1dd6ca2d8a5f883 100644 (file)
@@ -117,6 +117,9 @@ sub _cat_blob ($$$) {
        $n = read($r, my $lf, 1);
        defined($n) or die "read final byte of cat-blob failed: $!";
        die "bad read on final byte: <$lf>" if $lf ne "\n";
+
+       # fixup some bugginess in old versions:
+       $buf =~ s/\A[\r\n]*From [^\r\n]*\r?\n//s;
        \$buf;
 }
 
@@ -437,6 +440,8 @@ sub done {
        _update_git_info($self, 1) if delete $self->{nchg};
 
        $self->lock_release;
+
+       $self->{git}->cleanup;
 }
 
 sub atfork_child {