Code

Git 1.7.9.3
[git.git] / t / test-lib.sh
index a65dfc7ea93b3ec95e6ab7cd5b758029fe599d22..c0d04c494ae5892b539eed13f9717db27d1ec860 100644 (file)
@@ -42,10 +42,11 @@ TZ=UTC
 TERM=dumb
 export LANG LC_ALL PAGER TERM TZ
 EDITOR=:
-unset VISUAL
-unset EMAIL
-unset LANGUAGE
-unset $(perl -e '
+# A call to "unset" with no arguments causes at least Solaris 10
+# /usr/xpg4/bin/sh and /bin/ksh to bail out.  So keep the unsets
+# deriving from the command substitution clustered with the other
+# ones.
+unset VISUAL EMAIL LANGUAGE $(perl -e '
        my @env = keys %ENV;
        my $ok = join("|", qw(
                TRACE
@@ -381,11 +382,20 @@ test_config () {
        git config "$@"
 }
 
+
 test_config_global () {
        test_when_finished "test_unconfig --global '$1'" &&
        git config --global "$@"
 }
 
+write_script () {
+       {
+               echo "#!${2-"$SHELL_PATH"}" &&
+               cat
+       } >"$1" &&
+       chmod +x "$1"
+}
+
 # Use test_set_prereq to tell that a particular prerequisite is available.
 # The prerequisite can later be checked for in two ways:
 #