Imported Upstream version 2.15.0
[platform/upstream/git.git] / t / t7102-reset.sh
index ee703be..95653a0 100755 (executable)
@@ -44,7 +44,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=$test_encoding" commit -a -m "$(commit_msg $test_encoding)" &&
+       # "git commit -m" would break MinGW, as Windows refuse to pass
+       # $test_encoding encoded parameter to git.
+       commit_msg $test_encoding | git -c "i18n.commitEncoding=$test_encoding" commit -a -F - &&
        head5=$(git rev-parse --verify HEAD)
 '
 # git log --pretty=oneline # to see those SHA1 involved
@@ -64,14 +66,14 @@ 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 &&
-       test_cmp .expected .actual
+       test_i18ncmp .expected .actual
 '
 
 test_expect_success 'reset --hard message (ISO8859-1 logoutputencoding)' '
        hex=$(git log -1 --format="%h") &&
        git -c "i18n.logOutputEncoding=$test_encoding" reset --hard > .actual &&
        echo HEAD is now at $hex $(commit_msg $test_encoding) > .expected &&
-       test_cmp .expected .actual
+       test_i18ncmp .expected .actual
 '
 
 >.diff_expect
@@ -334,7 +336,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=$test_encoding" commit -a -m "$(commit_msg $test_encoding)" &&
+       # "git commit -m" would break MinGW, as Windows refuse to pass
+       # $test_encoding encoded parameter to git.
+       commit_msg $test_encoding | git -c "i18n.commitEncoding=$test_encoding" commit -a -F - &&
        check_changes $head5
 '
 
@@ -424,9 +428,9 @@ test_expect_success 'test --mixed <paths>' '
        git reset HEAD -- file1 file2 file3 &&
        test_must_fail git diff --quiet &&
        git diff > output &&
-       test_cmp output expect &&
+       test_cmp expect output &&
        git diff --cached > output &&
-       test_cmp output cached_expect
+       test_cmp cached_expect output
 '
 
 test_expect_success 'test resetting the index at give paths' '