Skip to content

Commit 4d26a96

Browse files
committed
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 <[email protected]>
1 parent 42954e5 commit 4d26a96

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

t/t7102-reset.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ commit_msg () {
1616
msg="modify 2nd file (ge\303\244ndert)\n"
1717
if test -n "$1"
1818
then
19-
printf "$msg" | iconv -f utf-8 -t "$1"
19+
printf "$msg" | iconv -t "$1"
2020
else
2121
printf "$msg"
2222
fi
@@ -60,7 +60,7 @@ check_changes () {
6060
test_expect_success 'reset --hard message' '
6161
hex=$(git log -1 --format="%h") &&
6262
git reset --hard > .actual &&
63-
echo HEAD is now at $hex $(commit_msg) > .expected &&
63+
echo HEAD is now at $hex $(commit_msg utf-8) > .expected &&
6464
test_cmp .expected .actual
6565
'
6666

0 commit comments

Comments
 (0)