about summary refs log tree commit homepage
path: root/lib/PublicInbox/V2Writable.pm
diff options
context:
space:
mode:
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2019-06-09 02:51:39 +0000
committerEric Wong <e@80x24.org>2019-06-09 04:33:16 +0000
commitcfff674918e8fc3e0763ac4818c07e0ba7fa716e (patch)
tree047972c89a7becad40e35ae1b64c96b08cc35e89 /lib/PublicInbox/V2Writable.pm
parent46c68104d851ab4594ea979eebbcb415c2ef3a69 (diff)
downloadpublic-inbox-cfff674918e8fc3e0763ac4818c07e0ba7fa716e.tar.gz
Continuing the work by Eric Biederman in commit a118d58a402bd31b
("Import.pm: When purging replace a purged file with a zero length file"),
we can use a generic OID replacement mechanism to implement
purge.
Diffstat (limited to 'lib/PublicInbox/V2Writable.pm')
-rw-r--r--lib/PublicInbox/V2Writable.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm
index a435814a..d6f72b07 100644
--- a/lib/PublicInbox/V2Writable.pm
+++ b/lib/PublicInbox/V2Writable.pm
@@ -298,7 +298,7 @@ sub idx_init {
 }
 
 sub purge_oids ($$) {
-        my ($self, $purge) = @_; # $purge = { $object_id => 1, ... }
+        my ($self, $purge) = @_; # $purge = { $object_id => \'', ... }
         $self->done;
         my $pfx = "$self->{-inbox}->{mainrepo}/git";
         my $purges = [];
@@ -313,7 +313,7 @@ sub purge_oids ($$) {
                 -d $git_dir or next;
                 my $git = PublicInbox::Git->new($git_dir);
                 my $im = $self->import_init($git, 0, 1);
-                $purges->[$i] = $im->purge_oids($purge);
+                $purges->[$i] = $im->replace_oids($purge);
                 $im->done;
         }
         $purges;
@@ -386,7 +386,7 @@ sub remove_internal ($$$$) {
                         $removed = $smsg;
                         my $oid = $smsg->{blob};
                         if ($purge) {
-                                $purge->{$oid} = 1;
+                                $purge->{$oid} = \'';
                         } else {
                                 ($mark, undef) = $im->remove($orig, $cmt_msg);
                         }