summaryrefslogtreecommitdiff
path: root/t/t3434-rebase-i18n.sh
diff options
context:
space:
mode:
authorDoan Tran Cong Danh <congdanhqx@gmail.com>2019-11-11 06:03:41 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-11-11 09:03:35 (GMT)
commit52f52e5ae4937de2bc798828c47c49f469b2cc85 (patch)
tree3297cc63e543a51340b998999e0673fbf7dfa40e /t/t3434-rebase-i18n.sh
parent5772b0c745ea7f57b94880f377e84a79e2675f38 (diff)
downloadgit-52f52e5ae4937de2bc798828c47c49f469b2cc85.zip
git-52f52e5ae4937de2bc798828c47c49f469b2cc85.tar.gz
git-52f52e5ae4937de2bc798828c47c49f469b2cc85.tar.bz2
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>
Diffstat (limited to 't/t3434-rebase-i18n.sh')
-rwxr-xr-xt/t3434-rebase-i18n.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/t/t3434-rebase-i18n.sh b/t/t3434-rebase-i18n.sh
index c6c1637..4b5b128 100755
--- a/t/t3434-rebase-i18n.sh
+++ b/t/t3434-rebase-i18n.sh
@@ -54,4 +54,31 @@ test_expect_failure 'rebase --rebase-merges update encoding eucJP to ISO-2022-JP
compare_msg eucJP.txt eucJP ISO-2022-JP
'
+test_rebase_continue_update_encode () {
+ old=$1
+ new=$2
+ msgfile=$3
+ test_expect_success "rebase --continue update from $old to $new" '
+ (git rebase --abort || : abort current git-rebase failure) &&
+ git switch -c conflict-$old-$new one &&
+ echo for-conflict >two.t &&
+ git add two.t &&
+ git config i18n.commitencoding $old &&
+ git commit -F "$TEST_DIRECTORY/t3434/$msgfile" &&
+ git config i18n.commitencoding $new &&
+ test_must_fail git rebase -m master &&
+ test -f .git/rebase-merge/message &&
+ git stripspace <.git/rebase-merge/message >two.t &&
+ git add two.t &&
+ git rebase --continue &&
+ compare_msg $msgfile $old $new &&
+ : git-commit assume invalid utf-8 is latin1 &&
+ test_cmp expect two.t
+ '
+}
+
+test_rebase_continue_update_encode ISO-8859-1 UTF-8 ISO8859-1.txt
+test_rebase_continue_update_encode eucJP UTF-8 eucJP.txt
+test_rebase_continue_update_encode eucJP ISO-2022-JP eucJP.txt
+
test_done