diff options
author | Elia Pinto <gitter.spiros@gmail.com> | 2014-06-06 07:55:51 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-06-09 14:47:07 -0700 |
commit | 1cb493739540bd196848a59f9b7765b0622f725c (patch) | |
tree | 8430f4216cb730e1d4bd7012f08b5d39715888de | |
parent | c82af12a1bde56fd7c3b984688ef7fe9f4c44b6e (diff) | |
download | git-1cb493739540bd196848a59f9b7765b0622f725c.tar.gz |
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>
-rwxr-xr-x | git-mergetool.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/git-mergetool.sh b/git-mergetool.sh index d08dc92589..9a046b75d1 100755 --- a/git-mergetool.sh +++ b/git-mergetool.sh @@ -205,7 +205,7 @@ checkout_staged_file () { "$(git checkout-index --temp --stage="$1" "$2" 2>/dev/null)" \ : '\([^ ]*\) ') - if test $? -eq 0 -a -n "$tmpfile" + if test $? -eq 0 && test -n "$tmpfile" then mv -- "$(git rev-parse --show-cdup)$tmpfile" "$3" else @@ -256,7 +256,7 @@ merge_file () { checkout_staged_file 2 "$MERGED" "$LOCAL" checkout_staged_file 3 "$MERGED" "$REMOTE" - if test -z "$local_mode" -o -z "$remote_mode" + if test -z "$local_mode" || test -z "$remote_mode" then echo "Deleted merge conflict for '$MERGED':" describe_file "$local_mode" "local" "$LOCAL" |