test-hg.sh: avoid obsolete 'test' syntax
authorRichard Hansen <rhansen@bbn.com>
Mon, 18 Nov 2013 04:12:47 +0000 (23:12 -0500)
committerJunio C Hamano <gitster@pobox.com>
Mon, 18 Nov 2013 21:45:58 +0000 (13:45 -0800)
The POSIX spec says that the '-a', '-o', and parentheses operands to
the 'test' utility are obsolete extensions due to the potential for
ambiguity. Replace '-o' with '|| test' to avoid unspecified behavior.

Signed-off-by: Richard Hansen <rhansen@bbn.com>
Reviewed-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/remote-helpers/test-hg.sh
index ceef6b1917b746008f308fdd5e81358c019bfd4f..5535e8c9be3f3f73c1b32fc1290cd58927bbfc0d 100755 (executable)
@@ -83,7 +83,7 @@ check_push () {
                test $ref_ret -ne 0 && echo "match for '$branch' failed" && break
        done
 
-       if test $expected_ret -ne $ret -o $ref_ret -ne 0
+       if test $expected_ret -ne $ret || test $ref_ret -ne 0
        then
                return 1
        fi