diff options
author | Alexey Shumkin <alex.crezoff@gmail.com> | 2014-05-21 17:20:04 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-05-21 11:10:06 -0700 |
commit | ee3efaf66c7599340a5deb030ee6969b6d7d39aa (patch) | |
tree | 211a29485f15223898de4d4860967777f90a5401 /t/t7102-reset.sh | |
parent | t4205 (log-pretty-formats): don't hardcode SHA-1 in expected outputs (diff) | |
download | tgif-ee3efaf66c7599340a5deb030ee6969b6d7d39aa.tar.xz |
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-x | t/t7102-reset.sh | 13 |
1 files changed, 8 insertions, 5 deletions
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 ' |