t7102: do not assume the system encoding is utf-8

The commit_msg function has an assumption that the string is being output
as utf-8. On Windows this is not true so always convert from the system
encoding to the desired encoding.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
This commit is contained in:
Pat Thoyts
2013-08-27 23:24:59 +01:00
parent 379e5cc9c2
commit 36c8ebed54

View File

@@ -16,7 +16,7 @@ commit_msg () {
msg="modify 2nd file (ge\303\244ndert)\n"
if test -n "$1"
then
printf "$msg" | iconv -f utf-8 -t "$1"
printf "$msg" | iconv -t "$1"
else
printf "$msg"
fi
@@ -60,7 +60,7 @@ check_changes () {
test_expect_success 'reset --hard message' '
hex=$(git log -1 --format="%h") &&
git reset --hard > .actual &&
echo HEAD is now at $hex $(commit_msg) > .expected &&
echo HEAD is now at $hex $(commit_msg utf-8) > .expected &&
test_cmp .expected .actual
'