git-mergetool.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 <gitter.spiros@gmail.com> Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Elia Pinto committed Jun 6, 2014 at 07:55 UTC 1cb493739540bd196848a59f9b7765b0622f725c
1 file changed +2 -2
git-mergetool.sh
+2 -2
@@ -205,7 +205,7 @@ checkout_staged_file () {
205 "$(git checkout-index --temp --stage="$1" "$2" 2>/dev/null)" \
206 : '\([^ ]*\) ')
207
208 - if test $? -eq 0 -a -n "$tmpfile"
208 + if test $? -eq 0 && test -n "$tmpfile"
209 then
210 mv -- "$(git rev-parse --show-cdup)$tmpfile" "$3"
211 else
@@ -256,7 +256,7 @@ merge_file () {
256 checkout_staged_file 2 "$MERGED" "$LOCAL"
257 checkout_staged_file 3 "$MERGED" "$REMOTE"
258
259 - if test -z "$local_mode" -o -z "$remote_mode"
259 + if test -z "$local_mode" || test -z "$remote_mode"
260 then
261 echo "Deleted merge conflict for '$MERGED':"
262 describe_file "$local_mode" "local" "$LOCAL"