]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/fast-export.c
fast-export: avoid stripping encoding header if we cannot reencode
authorElijah Newren <newren@gmail.com>
Tue, 14 May 2019 04:31:00 +0000 (21:31 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 14 May 2019 07:48:56 +0000 (16:48 +0900)
commitccbfc96dc480a1395f2068c706f53fe0881c8356
tree7c40bffdd5106c9199ffec5e30cdccc6c1b3ed73
parent3edfcc65fdfc708c1c8f1d314885eecf9beb9b67
fast-export: avoid stripping encoding header if we cannot reencode

When fast-export encounters a commit with an 'encoding' header, it tries
to reencode in UTF-8 and then drops the encoding header.  However, if it
fails to reencode in UTF-8 because e.g. one of the characters in the
commit message was invalid in the old encoding, then we need to retain
the original encoding or otherwise we lose information needed to
understand all the other (valid) characters in the original commit
message.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fast-export.c
t/t9350-fast-export.sh
t/t9350/broken-iso-8859-7-commit-message.txt [new file with mode: 0644]