]> Sergey Matveev's repositories - public-inbox.git/commitdiff
import: reset :raw mode for commit title (subject)
authorEric Wong <e@80x24.org>
Thu, 25 May 2017 02:24:16 +0000 (02:24 +0000)
committerEric Wong <e@80x24.org>
Thu, 25 May 2017 02:24:16 +0000 (02:24 +0000)
This was necessary for the presence of the 0xa0 byte(*)
in the Subject: of the message at:
http://blade.nagaokaut.ac.jp/ruby/ruby-core/3220

(*) That is 0xa0, not 0x0a ("\n"), so I wonder if the
    nibbles got swapped somehow.

lib/PublicInbox/Import.pm

index 13671a4fa3313f79e3c4d53813ab1cb815ecb032..65da4ddf466ad4a7309655e6436a4abb58abf742 100644 (file)
@@ -191,11 +191,10 @@ sub add {
        binmode $w, ':utf8' or die "binmode :utf8 failed: $!";
        print $w "commit $ref\nmark :$commit\n",
                "author $name <$email> $date\n",
-               "committer $self->{ident} ", now2822(), "\n",
-               "data ", (bytes::length($subject) + 1), "\n",
-               $subject, "\n\n" or wfail;
+               "committer $self->{ident} ", now2822(), "\n" or wfail;
        binmode $w, ':raw' or die "binmode :raw failed: $!";
-
+       print $w "data ", (bytes::length($subject) + 1), "\n",
+               $subject, "\n\n" or wfail;
        if ($tip ne '') {
                print $w 'from ', ($parent ? $parent : $tip), "\n" or wfail;
        }