aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElia Pinto <gitter.spiros@gmail.com>2014-06-06 07:55:47 -0700
committerJunio C Hamano <gitster@pobox.com>2014-06-09 14:47:06 -0700
commit57b74cdaba2aaaee7d29838a7e6f3ed5581b1992 (patch)
treef7633b003d9e1707d44fc38c8018d4fed7526609
parent0783df5d2603c97a481be839bdc65088787dde1b (diff)
downloadgit-57b74cdaba2aaaee7d29838a7e6f3ed5581b1992.tar.gz
git-57b74cdaba2aaaee7d29838a7e6f3ed5581b1992.tar.xz
contrib/examples/git-merge.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>
-rwxr-xr-xcontrib/examples/git-merge.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/examples/git-merge.sh b/contrib/examples/git-merge.sh
index 7e40f40c7..52f2aafb9 100755
--- a/contrib/examples/git-merge.sh
+++ b/contrib/examples/git-merge.sh
@@ -161,7 +161,7 @@ merge_name () {
return
fi
fi
- if test "$remote" = "FETCH_HEAD" -a -r "$GIT_DIR/FETCH_HEAD"
+ if test "$remote" = "FETCH_HEAD" && test -r "$GIT_DIR/FETCH_HEAD"
then
sed -e 's/ not-for-merge / /' -e 1q \
"$GIT_DIR/FETCH_HEAD"
@@ -527,7 +527,7 @@ do
git diff-files --name-only
git ls-files --unmerged
} | wc -l`
- if test $best_cnt -le 0 -o $cnt -le $best_cnt
+ if test $best_cnt -le 0 || test $cnt -le $best_cnt
then
best_strategy=$strategy
best_cnt=$cnt