gitweb: Make i18n (encoding) tests in t9500 leave clean state
The most important issue is that after unsetting `i18n.commitencoding' config variable t9500 no longer will use author and comitter name containing ISO-8859-1 characters, which are invalid UTF-8 characters. Besides it is good practice in general to clean up the state in tests. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jakub Narebski committed
Feb 27, 2011 at 17:58 UTC
e5ea66f9e545588c92cf228cca16f0b52d467bb5
1 file changed
+5
-1
t/t9500-gitweb-standalone-no-errors.sh
+5
-1
@@ -446,6 +446,8 @@ test_expect_success \
446
test_expect_success \
447
'encode(commit): utf8' \
448
'. "$TEST_DIRECTORY"/t3901-utf8.txt &&
449
+ test_when_finished "GIT_AUTHOR_NAME=\"A U Thor\"" &&
450
+ test_when_finished "GIT_COMMITTER_NAME=\"C O Mitter\"" &&
451
echo "UTF-8" >> file &&
452
git add file &&
453
git commit -F "$TEST_DIRECTORY"/t3900/1-UTF-8.txt &&
@@ -454,11 +456,13 @@ test_expect_success \
456
test_expect_success \
457
'encode(commit): iso-8859-1' \
458
'. "$TEST_DIRECTORY"/t3901-8859-1.txt &&
459
+ test_when_finished "GIT_AUTHOR_NAME=\"A U Thor\"" &&
460
+ test_when_finished "GIT_COMMITTER_NAME=\"C O Mitter\"" &&
461
echo "ISO-8859-1" >> file &&
462
git add file &&
463
git config i18n.commitencoding ISO-8859-1 &&
464
+ test_when_finished "git config --unset i18n.commitencoding" &&
465
git commit -F "$TEST_DIRECTORY"/t3900/ISO8859-1.txt &&
461
- git config --unset i18n.commitencoding &&
466
gitweb_run "p=.git;a=commit"'
467
468
test_expect_success \