about summary refs log tree commit homepage
path: root/lib/PublicInbox/Import.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/Import.pm')
-rw-r--r--lib/PublicInbox/Import.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/PublicInbox/Import.pm b/lib/PublicInbox/Import.pm
index 31dc7695..8c9d1cba 100644
--- a/lib/PublicInbox/Import.pm
+++ b/lib/PublicInbox/Import.pm
@@ -90,7 +90,7 @@ sub _check_path ($$$$) {
 # ('MISMATCH', msg) on mismatch
 # (:MARK, msg) on success
 sub remove {
-        my ($self, $mime) = @_; # mime = Email::MIME
+        my ($self, $mime, $msg) = @_; # mime = Email::MIME
 
         my $mid = mid_mime($mime);
         my $path = mid2path($mid);
@@ -138,10 +138,12 @@ sub remove {
         }
         my $ident = $self->{ident};
         my $now = now2822();
+        $msg ||= 'rm';
+        my $len = length($msg) + 1;
         print $w "commit $ref\nmark :$commit\n",
                 "author $ident $now\n",
                 "committer $ident $now\n",
-                "data 3\nrm\n\n",
+                "data $len\n$msg\n\n",
                 'from ', ($parent ? $parent : $tip), "\n" or wfail;
         print $w "D $path\n\n" or wfail;
         $self->{nchg}++;