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>
Elia Pinto committed
Jun 6, 2014 at 07:55 UTC
57b74cdaba2aaaee7d29838a7e6f3ed5581b1992
1 file changed
+2
-2
contrib/examples/git-merge.sh
+2
-2
@@ -161,7 +161,7 @@ merge_name () {
161
return
162
fi
163
fi
164
- if test "$remote" = "FETCH_HEAD" -a -r "$GIT_DIR/FETCH_HEAD"
164
+ if test "$remote" = "FETCH_HEAD" && test -r "$GIT_DIR/FETCH_HEAD"
165
then
166
sed -e 's/ not-for-merge / /' -e 1q \
167
"$GIT_DIR/FETCH_HEAD"
@@ -527,7 +527,7 @@ do
527
git diff-files --name-only
528
git ls-files --unmerged
529
} | wc -l`
530
- if test $best_cnt -le 0 -o $cnt -le $best_cnt
530
+ if test $best_cnt -le 0 || test $cnt -le $best_cnt
531
then
532
best_strategy=$strategy
533
best_cnt=$cnt