summaryrefslogtreecommitdiff
path: root/t/t7102-reset.sh
diff options
context:
space:
mode:
authorAlexey Shumkin <alex.crezoff@gmail.com>2014-05-21 13:20:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-05-21 18:10:06 (GMT)
commitee3efaf66c7599340a5deb030ee6969b6d7d39aa (patch)
tree211a29485f15223898de4d4860967777f90a5401 /t/t7102-reset.sh
parent496a69802bc4035d5dc26c8d97144d8ae30e52c4 (diff)
downloadgit-ee3efaf66c7599340a5deb030ee6969b6d7d39aa.zip
git-ee3efaf66c7599340a5deb030ee6969b6d7d39aa.tar.gz
git-ee3efaf66c7599340a5deb030ee6969b6d7d39aa.tar.bz2
t4041, t4205, t6006, t7102: don't hardcode tested encoding value
The tested encoding is always available in a variable. Use it instead of hardcoding. Also, to be in line with other tests use ISO8859-1 (uppercase) rather then iso8859-1. Signed-off-by: Alexey Shumkin <Alex.Crezoff@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7102-reset.sh')
-rwxr-xr-xt/t7102-reset.sh13
1 files changed, 8 insertions, 5 deletions
diff --git a/t/t7102-reset.sh b/t/t7102-reset.sh
index 4505294..ee703be 100755
--- a/t/t7102-reset.sh
+++ b/t/t7102-reset.sh
@@ -22,6 +22,9 @@ commit_msg () {
fi
}
+# Tested non-UTF-8 encoding
+test_encoding="ISO8859-1"
+
test_expect_success 'creating initial files and commits' '
test_tick &&
echo "1st file" >first &&
@@ -41,7 +44,7 @@ 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 -c "i18n.commitEncoding=$test_encoding" commit -a -m "$(commit_msg $test_encoding)" &&
head5=$(git rev-parse --verify HEAD)
'
# git log --pretty=oneline # to see those SHA1 involved
@@ -64,10 +67,10 @@ test_expect_success 'reset --hard message' '
test_cmp .expected .actual
'
-test_expect_success 'reset --hard message (iso8859-1 logoutputencoding)' '
+test_expect_success 'reset --hard message (ISO8859-1 logoutputencoding)' '
hex=$(git log -1 --format="%h") &&
- git -c "i18n.logOutputEncoding=iso8859-1" reset --hard > .actual &&
- echo HEAD is now at $hex $(commit_msg iso8859-1) > .expected &&
+ git -c "i18n.logOutputEncoding=$test_encoding" reset --hard > .actual &&
+ echo HEAD is now at $hex $(commit_msg $test_encoding) > .expected &&
test_cmp .expected .actual
'
@@ -331,7 +334,7 @@ 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 -c "i18n.commitEncoding=$test_encoding" commit -a -m "$(commit_msg $test_encoding)" &&
check_changes $head5
'