]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Import.pm
update and add documentation for repository formats
[public-inbox.git] / lib / PublicInbox / Import.pm
index bfa7a8053297a50c44c5e1f4fe173fbd7f882bbf..29c482f9b4339b09089421723f3991b24e57f553 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2016-2018 all contributors <meta@public-inbox.org>
+# Copyright (C) 2016-2019 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 #
 # git fast-import-based ssoma-mda MDA replacement
@@ -519,11 +519,12 @@ sub purge_oids {
                        push @buf, $buf;
                } elsif (/^M 100644 ([a-f0-9]+) (\w+)/) {
                        my ($oid, $path) = ($1, $2);
+                       $tree->{$path} = 1;
                        if ($purge->{$oid}) {
                                push @oids, $oid;
-                               delete $tree->{$path};
+                               my $cmd = "M 100644 inline $path\ndata 0\n\n";
+                               push @buf, $cmd;
                        } else {
-                               $tree->{$path} = 1;
                                push @buf, $_;
                        }
                } elsif (/^D (\w+)/) {
@@ -634,8 +635,8 @@ version 1.0
 =head1 DESCRIPTION
 
 An importer and remover for public-inboxes which takes L<Email::MIME>
-messages as input and stores them in a ssoma repository as
-documented in L<https://ssoma.public-inbox.org/ssoma_repository.txt>,
+messages as input and stores them in a git repository as
+documented in L<https://public-inbox.org/public-inbox-v1-format.txt>,
 except it does not allow duplicate Message-IDs.
 
 It requires L<git(1)> and L<git-fast-import(1)> to be installed.