Merge branch 'so/rebase-doc' into maint
[gitweb.git] / t / t4041-diff-submodule-option.sh
index 1751c8330709c56a4b7019513e30434741847b95..e4328964a7599846c9a8f96a01882aff2dc19296 100755 (executable)
@@ -11,6 +11,9 @@ This test tries to verify the sanity of the --submodule option of git diff.
 
 . ./test-lib.sh
 
+# Tested non-UTF-8 encoding
+test_encoding="ISO8859-1"
+
 # 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")
@@ -23,8 +26,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
+                       # $test_encoding encoded parameter to git.
+                       echo "Add $name ($added $name)" | iconv -f utf-8 -t $test_encoding |
+                       git -c "i18n.commitEncoding=$test_encoding" commit -F -
                done >/dev/null &&
                git rev-parse --short --verify HEAD
        )