Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 0cfe6fd

Browse files
devzero2000gitster
authored andcommitted
t/test-lib-functions.sh: avoid "test <cond> -a/-o <cond>"
The construct is error-prone; "test" being built-in in most modern shells, the reason to avoid "test <cond> && test <cond>" spawning one extra process by using a single "test <cond> -a <cond>" no longer exists. Signed-off-by: Elia Pinto <[email protected]> Reviewed-by: Matthieu Moy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 795fcb0 commit 0cfe6fd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

t/test-lib-functions.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ test_must_fail () {
542542
if test $exit_code = 0; then
543543
echo >&2 "test_must_fail: command succeeded: $*"
544544
return 1
545-
elif test $exit_code -gt 129 -a $exit_code -le 192; then
545+
elif test $exit_code -gt 129 && test $exit_code -le 192; then
546546
echo >&2 "test_must_fail: died by signal: $*"
547547
return 1
548548
elif test $exit_code = 127; then
@@ -569,7 +569,7 @@ test_must_fail () {
569569
test_might_fail () {
570570
"$@"
571571
exit_code=$?
572-
if test $exit_code -gt 129 -a $exit_code -le 192; then
572+
if test $exit_code -gt 129 && test $exit_code -le 192; then
573573
echo >&2 "test_might_fail: died by signal: $*"
574574
return 1
575575
elif test $exit_code = 127; then

0 commit comments

Comments
 (0)