From: Elia Pinto Date: Fri, 6 Jun 2014 14:55:47 +0000 (-0700) Subject: contrib/examples/git-merge.sh: avoid "test -a/-o " X-Git-Tag: v2.1.0-rc0~79^2~16 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/57b74cdaba2aaaee7d29838a7e6f3ed5581b1992?ds=inline;hp=--cc contrib/examples/git-merge.sh: avoid "test -a/-o " The construct is error-prone; "test" being built-in in most modern shells, the reason to avoid "test && test " spawning one extra process by using a single "test -a " no longer exists. Signed-off-by: Elia Pinto Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- 57b74cdaba2aaaee7d29838a7e6f3ed5581b1992 diff --git a/contrib/examples/git-merge.sh b/contrib/examples/git-merge.sh index 7e40f40c78..52f2aafb9d 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