about summary refs log tree commit homepage
path: root/lib/PublicInbox/Import.pm
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2018-08-09 19:08:22 -0500
committerEric Wong <e@80x24.org>2018-08-10 08:13:38 +0000
commita118d58a402bd31b5cd728a183305581b7d5557e (patch)
treecd3f2d048edb86a9ce5fe0f7e95eaffecb885040 /lib/PublicInbox/Import.pm
parentce5494b5b830e9b8b60815ccd81218390dc0d5db (diff)
downloadpublic-inbox-a118d58a402bd31b5cd728a183305581b7d5557e.tar.gz
This ensures that the number of added files remains the same and thus
the article numbers derived from a repository will remain the same.

I think this is the last place in public-inbox that has to be tweaked to
guarantee the generated article number will remain the same in an public
inbox archive.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'lib/PublicInbox/Import.pm')
-rw-r--r--lib/PublicInbox/Import.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/PublicInbox/Import.pm b/lib/PublicInbox/Import.pm
index bfa7a805..3df7d98f 100644
--- a/lib/PublicInbox/Import.pm
+++ b/lib/PublicInbox/Import.pm
@@ -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+)/) {