Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 5120b9a

Browse files
committed
Merge pull request #156 from kasal/test-fix-rev
Fix test suite issues with iso8859-1 parameters
2 parents 105500f + 126c186 commit 5120b9a

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

t/t4041-diff-submodule-option.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This test tries to verify the sanity of the --submodule option of git diff.
1313

1414
# String "added" in German (translated with Google Translate), encoded in UTF-8,
1515
# used in sample commit log messages in add_file() function below.
16-
added=$(printf "hinzugef\303\274gt" | iconv -t utf-8)
16+
added=$(printf "hinzugef\303\274gt")
1717
add_file () {
1818
(
1919
cd "$1" &&
@@ -23,8 +23,10 @@ add_file () {
2323
echo "$name" >"$name" &&
2424
git add "$name" &&
2525
test_tick &&
26-
msg_added_iso88591=$(echo "Add $name ($added $name)" | iconv -f utf-8 -t iso8859-1) &&
27-
git -c 'i18n.commitEncoding=iso8859-1' commit -m "$msg_added_iso88591"
26+
# "git commit -m" would break MinGW, as Windows refuse to pass
27+
# iso8859-1 encoded parameter to git.
28+
echo "Add $name ($added $name)" | iconv -f utf-8 -t iso8859-1 |
29+
git -c 'i18n.commitEncoding=iso8859-1' commit -F -
2830
done >/dev/null &&
2931
git rev-parse --short --verify HEAD
3032
)

t/t4205-log-pretty-formats.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ test_expect_success 'set up basic repos' '
2828
git add foo &&
2929
test_tick &&
3030
git config i18n.commitEncoding iso8859-1 &&
31-
commit_msg iso8859-1 > commit_msg &&
32-
git commit --file commit_msg &&
31+
# "git commit -m" would break MinGW, as Windows refuse to pass
32+
# iso8859-1 encoded parameter to git.
33+
commit_msg iso8859-1 | git commit -F - &&
3334
git add bar &&
3435
test_tick &&
3536
git commit -m "add bar" &&

t/t7102-reset.sh

Lines changed: 8 additions & 4 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 -t "$1"
19+
printf "$msg" | iconv -f utf-8 -t "$1"
2020
else
2121
printf "$msg"
2222
fi
@@ -41,7 +41,9 @@ test_expect_success 'creating initial files and commits' '
4141
4242
echo "1st line 2nd file" >secondfile &&
4343
echo "2nd line 2nd file" >>secondfile &&
44-
git -c "i18n.commitEncoding=iso8859-1" commit -a -m "$(commit_msg iso8859-1)" &&
44+
# "git commit -m" would break MinGW, as Windows refuse to pass
45+
# iso8859-1 encoded parameter to git.
46+
commit_msg iso8859-1 | git -c "i18n.commitEncoding=iso8859-1" commit -a -F - &&
4547
head5=$(git rev-parse --verify HEAD)
4648
'
4749
# git log --pretty=oneline # to see those SHA1 involved
@@ -60,7 +62,7 @@ check_changes () {
6062
test_expect_success 'reset --hard message' '
6163
hex=$(git log -1 --format="%h") &&
6264
git reset --hard > .actual &&
63-
echo HEAD is now at $hex $(commit_msg utf-8) > .expected &&
65+
echo HEAD is now at $hex $(commit_msg) > .expected &&
6466
test_cmp .expected .actual
6567
'
6668

@@ -331,7 +333,9 @@ test_expect_success 'redoing the last two commits should succeed' '
331333
332334
echo "1st line 2nd file" >secondfile &&
333335
echo "2nd line 2nd file" >>secondfile &&
334-
git -c "i18n.commitEncoding=iso8859-1" commit -a -m "$(commit_msg iso8859-1)" &&
336+
# "git commit -m" would break MinGW, as Windows refuse to pass
337+
# iso8859-1 encoded parameter to git.
338+
commit_msg iso8859-1 | git -c "i18n.commitEncoding=iso8859-1" commit -a -F - &&
335339
check_changes $head5
336340
'
337341

0 commit comments

Comments
 (0)