summaryrefslogtreecommitdiff
path: root/contrib/examples/git-commit.sh
diff options
context:
space:
mode:
authorElia Pinto <gitter.spiros@gmail.com>2014-06-06 14:55:46 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-06-09 21:47:06 (GMT)
commit0783df5d2603c97a481be839bdc65088787dde1b (patch)
tree29956712323d5d1a86003de812edbeac65f07c53 /contrib/examples/git-commit.sh
parentcb9d69ad638fe34d214cf9cb2850e38be6e6d639 (diff)
downloadgit-0783df5d2603c97a481be839bdc65088787dde1b.zip
git-0783df5d2603c97a481be839bdc65088787dde1b.tar.gz
git-0783df5d2603c97a481be839bdc65088787dde1b.tar.bz2
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>
Diffstat (limited to 'contrib/examples/git-commit.sh')
-rwxr-xr-xcontrib/examples/git-commit.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/examples/git-commit.sh b/contrib/examples/git-commit.sh
index 5cafe2e..934505b 100755
--- a/contrib/examples/git-commit.sh
+++ b/contrib/examples/git-commit.sh
@@ -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