Code

gitweb: Add tests for overriding gitweb config with repo config
[git.git] / t / test-lib.sh
index 66efcdaacd72c0242a567830ea9a4cf95fc0860d..603a8cd5e7c53569fea3dba66754b52ea1fad9ba 100644 (file)
@@ -60,6 +60,7 @@ esac
 # . ./test-lib.sh
 
 [ "x$TERM" != "xdumb" ] &&
+       [ -t 1 ] &&
        tput bold >/dev/null 2>&1 &&
        tput setaf 1 >/dev/null 2>&1 &&
        tput sgr0 >/dev/null 2>&1 &&
@@ -80,6 +81,8 @@ do
                exit 0 ;;
        -v|--v|--ve|--ver|--verb|--verbo|--verbos|--verbose)
                verbose=t; shift ;;
+       -q|--q|--qu|--qui|--quie|--quiet)
+               quiet=t; shift ;;
        --no-color)
            color=; shift ;;
        --no-python)
@@ -97,7 +100,7 @@ if test -n "$color"; then
                        skip)  tput bold; tput setaf 2;; # bold green
                        pass)  tput setaf 2;;            # green
                        info)  tput setaf 3;;            # brown
-                       *);;
+                       *) test -n "$quiet" && return;;
                esac
                shift
                echo "* $*"
@@ -105,6 +108,7 @@ if test -n "$color"; then
        }
 else
        say_color() {
+               test -z "$1" && test -n "$quiet" && return
                shift
                echo "* $*"
        }