Git fork

sequencer: reencode commit message for am/rebase --show-current-patch

The message file will be used as commit message for the
git-{am,rebase} --continue.

Signed-off-by: Doan Tran Cong Danh <congdanhqx@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Doan Tran Cong Danh and committed by
Junio C Hamano
52f52e5a 5772b0c7

+32 -1
+2 -1
sequencer.c
··· 2972 2972 2973 2973 strbuf_addf(&buf, "%s/message", get_dir(opts)); 2974 2974 if (!file_exists(buf.buf)) { 2975 - const char *commit_buffer = get_commit_buffer(commit, NULL); 2975 + const char *encoding = get_commit_output_encoding(); 2976 + const char *commit_buffer = logmsg_reencode(commit, NULL, encoding); 2976 2977 find_commit_subject(commit_buffer, &subject); 2977 2978 res |= write_message(subject, strlen(subject), buf.buf, 1); 2978 2979 unuse_commit_buffer(commit, commit_buffer);
+27
t/t3434-rebase-i18n.sh
··· 54 54 compare_msg eucJP.txt eucJP ISO-2022-JP 55 55 ' 56 56 57 + test_rebase_continue_update_encode () { 58 + old=$1 59 + new=$2 60 + msgfile=$3 61 + test_expect_success "rebase --continue update from $old to $new" ' 62 + (git rebase --abort || : abort current git-rebase failure) && 63 + git switch -c conflict-$old-$new one && 64 + echo for-conflict >two.t && 65 + git add two.t && 66 + git config i18n.commitencoding $old && 67 + git commit -F "$TEST_DIRECTORY/t3434/$msgfile" && 68 + git config i18n.commitencoding $new && 69 + test_must_fail git rebase -m master && 70 + test -f .git/rebase-merge/message && 71 + git stripspace <.git/rebase-merge/message >two.t && 72 + git add two.t && 73 + git rebase --continue && 74 + compare_msg $msgfile $old $new && 75 + : git-commit assume invalid utf-8 is latin1 && 76 + test_cmp expect two.t 77 + ' 78 + } 79 + 80 + test_rebase_continue_update_encode ISO-8859-1 UTF-8 ISO8859-1.txt 81 + test_rebase_continue_update_encode eucJP UTF-8 eucJP.txt 82 + test_rebase_continue_update_encode eucJP ISO-2022-JP eucJP.txt 83 + 57 84 test_done
+3
t/t3434/ISO8859-1.txt
··· 1 + ����� 2 + 3 + �b�d�fg