Sync with 1.7.4.5
[gitweb.git] / t / test-lib.sh
index 8aac727fb22eedc7ae57c0db94f1b3405df0de57..abc47f3abc5d925ed217d0d95f10bf078bc26034 100644 (file)
@@ -46,7 +46,16 @@ unset VISUAL
 unset EMAIL
 unset $(perl -e '
        my @env = keys %ENV;
-       my @vars = grep(/^GIT_/ && !/^GIT_(TRACE|DEBUG|USE_LOOKUP)/, @env);
+       my $ok = join("|", qw(
+               TRACE
+               DEBUG
+               USE_LOOKUP
+               TEST
+               .*_TEST
+               PROVE
+               VALGRIND
+       ));
+       my @vars = grep(/^GIT_/ && !/^GIT_($ok)/o, @env);
        print join("\n", @vars);
 ')
 GIT_AUTHOR_EMAIL=author@example.com
@@ -984,14 +993,14 @@ rm -fr "$test" || {
        exit 1
 }
 
+HOME="$TRASH_DIRECTORY"
+export HOME
+
 test_create_repo "$test"
 # Use -P to resolve symlinks in our working directory so that the cwd
 # in subprocesses like git equals our $PWD (for pathname comparisons).
 cd -P "$test" || exit 1
 
-HOME=$(pwd)
-export HOME
-
 this_test=${0##*/}
 this_test=${this_test%%-*}
 for skp in $GIT_SKIP_TESTS
@@ -1059,6 +1068,15 @@ esac
 test -z "$NO_PERL" && test_set_prereq PERL
 test -z "$NO_PYTHON" && test_set_prereq PYTHON
 
+# Can we rely on git's output in the C locale?
+if test -n "$GETTEXT_POISON"
+then
+       GIT_GETTEXT_POISON=YesPlease
+       export GIT_GETTEXT_POISON
+else
+       test_set_prereq C_LOCALE_OUTPUT
+fi
+
 # test whether the filesystem supports symbolic links
 ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS
 rm -f y