diff --git a/t/t4041-diff-submodule-option.sh b/t/t4041-diff-submodule-option.sh index 306b233e270558..01e1f9be77617e 100755 --- a/t/t4041-diff-submodule-option.sh +++ b/t/t4041-diff-submodule-option.sh @@ -13,7 +13,7 @@ This test tries to verify the sanity of the --submodule option of git diff. # String "added" in German (translated with Google Translate), encoded in UTF-8, # used in sample commit log messages in add_file() function below. -added=$(printf "hinzugef\303\274gt" | iconv -t utf-8) +added=$(printf "hinzugef\303\274gt") add_file () { ( cd "$1" && @@ -23,8 +23,10 @@ add_file () { echo "$name" >"$name" && git add "$name" && test_tick && - msg_added_iso88591=$(echo "Add $name ($added $name)" | iconv -f utf-8 -t iso8859-1) && - git -c 'i18n.commitEncoding=iso8859-1' commit -m "$msg_added_iso88591" + # "git commit -m" would break MinGW, as Windows refuse to pass + # iso8859-1 encoded parameter to git. + echo "Add $name ($added $name)" | iconv -f utf-8 -t iso8859-1 | + git -c 'i18n.commitEncoding=iso8859-1' commit -F - done >/dev/null && git rev-parse --short --verify HEAD ) diff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh index ca532d36d2d61a..f27b0b390af13f 100755 --- a/t/t4205-log-pretty-formats.sh +++ b/t/t4205-log-pretty-formats.sh @@ -28,8 +28,9 @@ test_expect_success 'set up basic repos' ' git add foo && test_tick && git config i18n.commitEncoding iso8859-1 && - commit_msg iso8859-1 > commit_msg && - git commit --file commit_msg && + # "git commit -m" would break MinGW, as Windows refuse to pass + # iso8859-1 encoded parameter to git. + commit_msg iso8859-1 | git commit -F - && git add bar && test_tick && git commit -m "add bar" && diff --git a/t/t7102-reset.sh b/t/t7102-reset.sh index b05910962b27e3..b5fa177a54b07c 100755 --- a/t/t7102-reset.sh +++ b/t/t7102-reset.sh @@ -16,7 +16,7 @@ commit_msg () { msg="modify 2nd file (ge\303\244ndert)\n" if test -n "$1" then - printf "$msg" | iconv -t "$1" + printf "$msg" | iconv -f utf-8 -t "$1" else printf "$msg" fi @@ -41,7 +41,9 @@ test_expect_success 'creating initial files and commits' ' echo "1st line 2nd file" >secondfile && echo "2nd line 2nd file" >>secondfile && - git -c "i18n.commitEncoding=iso8859-1" commit -a -m "$(commit_msg iso8859-1)" && + # "git commit -m" would break MinGW, as Windows refuse to pass + # iso8859-1 encoded parameter to git. + commit_msg iso8859-1 | git -c "i18n.commitEncoding=iso8859-1" commit -a -F - && head5=$(git rev-parse --verify HEAD) ' # git log --pretty=oneline # to see those SHA1 involved @@ -60,7 +62,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 utf-8) > .expected && + echo HEAD is now at $hex $(commit_msg) > .expected && test_cmp .expected .actual ' @@ -331,7 +333,9 @@ test_expect_success 'redoing the last two commits should succeed' ' echo "1st line 2nd file" >secondfile && echo "2nd line 2nd file" >>secondfile && - git -c "i18n.commitEncoding=iso8859-1" commit -a -m "$(commit_msg iso8859-1)" && + # "git commit -m" would break MinGW, as Windows refuse to pass + # iso8859-1 encoded parameter to git. + commit_msg iso8859-1 | git -c "i18n.commitEncoding=iso8859-1" commit -a -F - && check_changes $head5 '