1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-10-31 14:27:54 +01:00

contrib/examples/git-commit.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>
This commit is contained in:
Elia Pinto 2014-06-06 07:55:46 -07:00 committed by Junio C Hamano
parent cb9d69ad63
commit 0783df5d26

View file

@ -51,7 +51,7 @@ run_status () {
export GIT_INDEX_FILE
fi
if test "$status_only" = "t" -o "$use_status_color" = "t"; then
if test "$status_only" = "t" || test "$use_status_color" = "t"; then
color=
else
color=--nocolor
@ -296,7 +296,7 @@ t,,,[1-9]*)
die "No paths with -i does not make sense." ;;
esac
if test ! -z "$templatefile" -a -z "$log_given"
if test ! -z "$templatefile" && test -z "$log_given"
then
if test ! -f "$templatefile"
then