From cfff674918e8fc3e0763ac4818c07e0ba7fa716e Mon Sep 17 00:00:00 2001 From: "Eric Wong (Contractor, The Linux Foundation)" Date: Sun, 9 Jun 2019 02:51:39 +0000 Subject: import: switch to "replace_oids" interface for purge 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. --- lib/PublicInbox/V2Writable.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/PublicInbox/V2Writable.pm') 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); } -- cgit v1.2.3-24-ge0c7