summaryrefslogtreecommitdiff
path: root/t/t6006-rev-list-format.sh
diff options
context:
space:
mode:
authorAlexey Shumkin <alex.crezoff@gmail.com>2014-05-21 13:20:07 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-05-21 18:13:30 (GMT)
commit7d509878b845a2a895cc880b833a016a06199981 (patch)
tree5e40401d011a00f8e5ebf676213d80e5a492c5db /t/t6006-rev-list-format.sh
parentd928d81051fc8475c7845526b255cb8e80b39f12 (diff)
downloadgit-7d509878b845a2a895cc880b833a016a06199981.zip
git-7d509878b845a2a895cc880b833a016a06199981.tar.gz
git-7d509878b845a2a895cc880b833a016a06199981.tar.bz2
pretty.c: format string with truncate respects logOutputEncoding
Pretty format string %<(N,[ml]trunc)>%s truncates subject to a given length with an appropriate padding. This works for non-ASCII texts when i18n.logOutputEncoding is UTF-8 only (independently of a printed commit message encoding) but does not work when i18n.logOutputEncoding is NOT UTF-8. In 7e77df3 (pretty: two phase conversion for non utf-8 commits, 2013-04-19) 'format_commit_item' function assumes commit message to be in UTF-8. And that was so until ecaee80 (pretty: --format output should honor logOutputEncoding, 2013-06-26) where conversion to logOutputEncoding was added before calling 'format_commit_message'. Correct this by converting a commit message to UTF-8 first (as it assumed in 7e77df3 (pretty: two phase conversion for non utf-8 commits, 2013-04-19)). Only after that convert a commit message to an actual logOutputEncoding. Signed-off-by: Alexey Shumkin <Alex.Crezoff@gmail.com> Reviewed-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6006-rev-list-format.sh')
-rwxr-xr-xt/t6006-rev-list-format.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh
index 680b960..c277db6 100755
--- a/t/t6006-rev-list-format.sh
+++ b/t/t6006-rev-list-format.sh
@@ -256,7 +256,7 @@ commit $head1
$added_iso88591
EOF
-test_format complex-subject-trunc "%<($truncate_count,trunc)%s" failure <<EOF
+test_format complex-subject-trunc "%<($truncate_count,trunc)%s" <<EOF
commit $head3
Test printing of c..
commit $head2
@@ -265,7 +265,7 @@ commit $head1
added (hinzugef${added_utf8_part_iso88591}gt..
EOF
-test_format complex-subject-mtrunc "%<($truncate_count,mtrunc)%s" failure <<EOF
+test_format complex-subject-mtrunc "%<($truncate_count,mtrunc)%s" <<EOF
commit $head3
Test prin..ex bodies
commit $head2
@@ -274,7 +274,7 @@ commit $head1
added (hi..f${added_utf8_part_iso88591}gt) foo
EOF
-test_format complex-subject-ltrunc "%<($truncate_count,ltrunc)%s" failure <<EOF
+test_format complex-subject-ltrunc "%<($truncate_count,ltrunc)%s" <<EOF
commit $head3
.. of complex bodies
commit $head2