Merge branch 'jk/ok-to-fail-gc-auto-in-rebase'
[gitweb.git] / contrib / examples / git-merge.sh
index 7e40f40c78e2b040ae5b85adb27ebd4828f42b4d..ee99f1a4ee89a9e9f358b6cc89fc84cab554b439 100755 (executable)
@@ -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"
@@ -523,11 +523,11 @@ do
 
        if test "$exit" -eq 1
        then
-           cnt=`{
+           cnt=$({
                git diff-files --name-only
                git ls-files --unmerged
-           } | wc -l`
-           if test $best_cnt -le 0 -o $cnt -le $best_cnt
+           } | wc -l)
+           if test $best_cnt -le 0 || test $cnt -le $best_cnt
            then
                best_strategy=$strategy
                best_cnt=$cnt