aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-12-03 13:56:50 -0800
committerJunio C Hamano <gitster@pobox.com>2009-12-03 13:56:50 -0800
commitdda8f4bf2b159d6f8e6d816e35418708cc6f21a1 (patch)
tree103c94df0d3f8b7793120d9fc43b22b9c61bea4e /t
parentc8b1d761f61c4be0b036620ba418ff0e97979fde (diff)
parent3994e8a98dc7bbf67e61d23c8125f44383499a1f (diff)
downloadgit-dda8f4bf2b159d6f8e6d816e35418708cc6f21a1.tar.gz
git-dda8f4bf2b159d6f8e6d816e35418708cc6f21a1.tar.xz
Merge branch 'uk/maint-shortlog-encoding' into maint
* uk/maint-shortlog-encoding: t4201: use ISO8859-1 rather than ISO-8859-1 shortlog: respect commit encoding
Diffstat (limited to 't')
-rwxr-xr-xt/t4201-shortlog.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/t/t4201-shortlog.sh b/t/t4201-shortlog.sh
index 405b97119..a01e55bf6 100755
--- a/t/t4201-shortlog.sh
+++ b/t/t4201-shortlog.sh
@@ -52,4 +52,32 @@ GIT_DIR=non-existing git shortlog -w < log > out
test_expect_success 'shortlog from non-git directory' 'test_cmp expect out'
+iconvfromutf8toiso88591() {
+ printf "%s" "$*" | iconv -f UTF-8 -t ISO8859-1
+}
+
+DSCHO="Jöhännës \"Dschö\" Schindëlin"
+DSCHOE="$DSCHO <Johannes.Schindelin@gmx.de>"
+MSG1="set a1 to 2 and some non-ASCII chars: Äßø"
+MSG2="set a1 to 3 and some non-ASCII chars: áæï"
+cat > expect << EOF
+$DSCHO (2):
+ $MSG1
+ $MSG2
+
+EOF
+
+test_expect_success 'shortlog encoding' '
+ git reset --hard "$commit" &&
+ git config --unset i18n.commitencoding &&
+ echo 2 > a1 &&
+ git commit --quiet -m "$MSG1" --author="$DSCHOE" a1 &&
+ git config i18n.commitencoding "ISO8859-1" &&
+ echo 3 > a1 &&
+ git commit --quiet -m "$(iconvfromutf8toiso88591 "$MSG2")" \
+ --author="$(iconvfromutf8toiso88591 "$DSCHOE")" a1 &&
+ git config --unset i18n.commitencoding &&
+ git shortlog HEAD~2.. > out &&
+test_cmp expect out'
+
test_done