sequencer: reencode squashing commit's message

On fixup/squash-ing rebase, git will create new commit in
i18n.commitencoding, reencode the commit message to that said encode.

Signed-off-by: Doan Tran Cong Danh <congdanhqx@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Doan Tran Cong Danh
2019-11-08 16:43:48 +07:00
committed by Junio C Hamano
parent 019a9d8362
commit b375744274
2 changed files with 14 additions and 4 deletions

View File

@@ -224,7 +224,15 @@ test_commit_autosquash_multi_encoding () {
git commit -a --$flag HEAD^ &&
git rebase --autosquash -i HEAD^^^ &&
git rev-list HEAD >actual &&
test_line_count = 3 actual
test_line_count = 3 actual &&
iconv -f $old -t UTF-8 "$TEST_DIRECTORY"/t3900/$msg >expect &&
if test $flag = squash; then
subject="$(head -1 expect)" &&
printf "\nsquash! %s\n" "$subject" >>expect
fi &&
git cat-file commit HEAD^ >raw &&
(sed "1,/^$/d" raw | iconv -f $new -t utf-8) >actual &&
test_cmp expect actual
'
}