From 072a8bf4bc83f1e7b7b6f603ef0403a78ce991d1 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 9 Apr 2016 09:07:16 +0000 Subject: import: set binmode before printing author names Author names may have wide characters in them, so avoid warnings as git favors UTF-8 for names and fast-import even requires them for commit messages --- lib/PublicInbox/Import.pm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/PublicInbox/Import.pm') diff --git a/lib/PublicInbox/Import.pm b/lib/PublicInbox/Import.pm index e2156f10..4c7bbf14 100644 --- a/lib/PublicInbox/Import.pm +++ b/lib/PublicInbox/Import.pm @@ -162,11 +162,16 @@ sub add { unless ($parent) { print $w "reset $ref\n" or wfail; } + + # quiet down wide character warnings: + 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 ", (length($subject) + 1), "\n", $subject, "\n\n" or wfail; + binmode $w, ':raw' or die "binmode :raw failed: $!"; + if ($tip ne '') { print $w 'from ', ($parent ? $parent : $tip), "\n" or wfail; } -- cgit v1.2.3-24-ge0c7