Skip to content

Commit 57b74cd

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

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

contrib/examples/git-merge.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ merge_name () {
161161
return
162162
fi
163163
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"
165165
then
166166
sed -e 's/ not-for-merge / /' -e 1q \
167167
"$GIT_DIR/FETCH_HEAD"
@@ -527,7 +527,7 @@ do
527527
git diff-files --name-only
528528
git ls-files --unmerged
529529
} | 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
531531
then
532532
best_strategy=$strategy
533533
best_cnt=$cnt

0 commit comments

Comments
 (0)