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:
parent
cb9d69ad63
commit
0783df5d26
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue