mirror of
https://github.com/git/git.git
synced 2026-02-07 16:27:02 +00:00
t4041, t7102: do not pass iso8859-1 parameter
git commit -m with some iso8859-1 encoded stuff is doomed to fail in MinGW, because Windows don't let you pass encoded bytes to a process (CreateProcessW always takes a UTF-16LE encoded string). Fix t4041, t7102 and update an older fix in t4205. Thanks-to: Karsten Blees <blees@dcon.de>
This commit is contained in:
@@ -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
|
||||
)
|
||||
|
||||
@@ -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" &&
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user