]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/V2Writable.pm
import: (v2) delete writes the blob into history in subdir
[public-inbox.git] / lib / PublicInbox / V2Writable.pm
index 656f0693a261f7dd92800557fd2f9c1ae30e2409..fd9bf615c66da24d88abd7bf2b091cd561dbf85a 100644 (file)
@@ -220,6 +220,7 @@ sub remove {
                                warn "broken smsg for $mid\n";
                                return 1; # continue
                        }
+                       my $orig = $$msg;
                        my $cur = PublicInbox::MIME->new($msg);
                        if (content_id($cur) eq $cid) {
                                $mm->num_delete($smsg->num);
@@ -227,7 +228,8 @@ sub remove {
                                # no bugs in our deduplication code:
                                $removed = $smsg;
                                $removed->{mime} = $cur;
-                               $im->remove($cur, $cmt_msg);
+                               $im->remove(\$orig, $cmt_msg);
+                               $orig = undef;
                                $removed->num; # memoize this for callers
 
                                my $oid = $smsg->{blob};