Skip to content

Commit 0783df5

Browse files
devzero2000gitster
authored andcommitted
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 <[email protected]> Reviewed-by: Matthieu Moy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent cb9d69a commit 0783df5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

contrib/examples/git-commit.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ run_status () {
5151
export GIT_INDEX_FILE
5252
fi
5353

54-
if test "$status_only" = "t" -o "$use_status_color" = "t"; then
54+
if test "$status_only" = "t" || test "$use_status_color" = "t"; then
5555
color=
5656
else
5757
color=--nocolor
@@ -296,7 +296,7 @@ t,,,[1-9]*)
296296
die "No paths with -i does not make sense." ;;
297297
esac
298298

299-
if test ! -z "$templatefile" -a -z "$log_given"
299+
if test ! -z "$templatefile" && test -z "$log_given"
300300
then
301301
if test ! -f "$templatefile"
302302
then

0 commit comments

Comments
 (0)