mirror of
https://github.com/git/git
synced 2024-08-28 03:59:25 +00: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
|
@ -51,7 +51,7 @@ run_status () {
|
||||||
export GIT_INDEX_FILE
|
export GIT_INDEX_FILE
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$status_only" = "t" -o "$use_status_color" = "t"; then
|
if test "$status_only" = "t" || test "$use_status_color" = "t"; then
|
||||||
color=
|
color=
|
||||||
else
|
else
|
||||||
color=--nocolor
|
color=--nocolor
|
||||||
|
@ -296,7 +296,7 @@ t,,,[1-9]*)
|
||||||
die "No paths with -i does not make sense." ;;
|
die "No paths with -i does not make sense." ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if test ! -z "$templatefile" -a -z "$log_given"
|
if test ! -z "$templatefile" && test -z "$log_given"
|
||||||
then
|
then
|
||||||
if test ! -f "$templatefile"
|
if test ! -f "$templatefile"
|
||||||
then
|
then
|
||||||
|
|
Loading…
Reference in a new issue