From ee3efaf66c7599340a5deb030ee6969b6d7d39aa Mon Sep 17 00:00:00 2001
From: Alexey Shumkin <alex.crezoff@gmail.com>
Date: Wed, 21 May 2014 17:20:04 +0400
Subject: 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>
---
 t/t7102-reset.sh | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

(limited to 't/t7102-reset.sh')

diff --git a/t/t7102-reset.sh b/t/t7102-reset.sh
index 450529404c..ee703bed64 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
 '
 
-- 
cgit v1.2.1