Merge branch 'sg/test-lib-simplify-expr-away'
authorJunio C Hamano <gitster@pobox.com>
Tue, 3 May 2016 21:08:14 +0000 (14:08 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 3 May 2016 21:08:14 +0000 (14:08 -0700)
Code cleanup.

* sg/test-lib-simplify-expr-away:
test-lib: simplify '--option=value' parsing

1  2 
t/test-lib.sh
diff --combined t/test-lib.sh
index cd0ecd444de0cb38bdcfda159f1e8c18b7fdce03,79afa8748eec6c8a9dece4db58c6efcfb343f2ae..286c5f33d1e7bac81045293f78d2adf69ce8378c
                }
                run_list=$1; shift ;;
        --run=*)
-               run_list=$(expr "z$1" : 'z[^=]*=\(.*\)'); shift ;;
+               run_list=${1#--*=}; shift ;;
        -h|--h|--he|--hel|--help)
                help=t; shift ;;
        -v|--v|--ve|--ver|--verb|--verbo|--verbos|--verbose)
                verbose=t; shift ;;
        --verbose-only=*)
-               verbose_only=$(expr "z$1" : 'z[^=]*=\(.*\)')
+               verbose_only=${1#--*=}
                shift ;;
        -q|--q|--qu|--qui|--quie|--quiet)
                # Ignore --quiet under a TAP::Harness. Saying how many tests
                valgrind=memcheck
                shift ;;
        --valgrind=*)
-               valgrind=$(expr "z$1" : 'z[^=]*=\(.*\)')
+               valgrind=${1#--*=}
                shift ;;
        --valgrind-only=*)
-               valgrind_only=$(expr "z$1" : 'z[^=]*=\(.*\)')
+               valgrind_only=${1#--*=}
                shift ;;
        --tee)
                shift ;; # was handled already
        --root=*)
-               root=$(expr "z$1" : 'z[^=]*=\(.*\)')
+               root=${1#--*=}
                shift ;;
        --chain-lint)
                GIT_TEST_CHAIN_LINT=1
@@@ -854,10 -854,10 +854,10 @@@ test -d "$GIT_BUILD_DIR"/templates/blt 
        error "You haven't built things yet, have you?"
  }
  
 -if ! test -x "$GIT_BUILD_DIR"/test-chmtime
 +if ! test -x "$GIT_BUILD_DIR"/t/helper/test-chmtime
  then
        echo >&2 'You need to build test-chmtime:'
 -      echo >&2 'Run "make test-chmtime" in the source (toplevel) directory'
 +      echo >&2 'Run "make t/helper/test-chmtime" in the source (toplevel) directory'
        exit 1
  fi