omni: Fix the echo merge conflicts

 * Drop the deprecated --force-broken option. It's true by default

 * Use porcelain option to grep if there's an merge conflict
   https://git-scm.com/docs/git-status/2.0.5

 * Only abandon merge if one merge conflict is in progress.

Change-Id: I610d423ad17442f1b1eea3c83a4a18dfe523c7ad
diff --git a/utils/aosp-merge.sh b/utils/aosp-merge.sh
index b4b6273..e4e33c6 100755
--- a/utils/aosp-merge.sh
+++ b/utils/aosp-merge.sh
@@ -44,7 +44,7 @@
 
     rm -fr $path;
     echo " -> repo sync ${path}";
-    ret=$(repo sync -d -f --force-sync ${path} 2>&1);
+    ret=$(repo sync -d --force-sync ${path} 2>&1);
     cd $path;
 
     if [[ "${OPERATION}" == "yes" ]]; then
@@ -57,13 +57,15 @@
         ret=$(repo start ${branch_name});
     fi
 
-    # make sure that environment is clean
-    ret=$(git merge --abort 2>&1);
+    if [[ -n "$(git status --porcelain)" ]]; then
+        # make sure that environment is clean
+        ret=$(git merge --abort 2>&1);
+    fi
 
     echo " -> Merging remote: https://android.googlesource.com/platform/$aosp_project ${ref}";
     ret=$(git pull https://android.googlesource.com/platform/$aosp_project ${ref} 2>&1);
 
-    if echo $ret | grep "CONFLICT (content)" > /dev/null ; then
+    if [[ -n "$(git status --porcelain)" ]]; then
         echo -e " -> \e[33mWARNING!: \e[31mMERGE CONFLICT\e[0m";
         echo -e " -> please fix the merge conflict before push it.";
     else
diff --git a/utils/caf-merge.sh b/utils/caf-merge.sh
index d2541c6..8b9022b 100755
--- a/utils/caf-merge.sh
+++ b/utils/caf-merge.sh
@@ -44,7 +44,7 @@
 
     rm -fr $path;
     echo " -> repo sync ${path}";
-    ret=$(repo sync -d -f --force-sync ${path} 2>&1);
+    ret=$(repo sync -d --force-sync ${path} 2>&1);
     cd $path;
 
     if [[ "${OPERATION}" == "yes" ]]; then
@@ -57,13 +57,15 @@
         ret=$(repo start ${branch_name});
     fi
 
-    # make sure that environment is clean
-    ret=$(git merge --abort 2>&1);
+    if [[ -n "$(git status --porcelain)" ]]; then
+        # make sure that environment is clean
+        ret=$(git merge --abort 2>&1);
+    fi
 
     echo " -> Merging remote: https://source.codeaurora.org/quic/la/platform/$caf_project ${ref}";
     ret=$(git pull https://source.codeaurora.org/quic/la/platform/$caf_project ${ref} 2>&1);
 
-    if echo $ret | grep "CONFLICT (content)" > /dev/null ; then
+    if [[ -n "$(git status --porcelain)" ]]; then
         echo -e " -> \e[33mWARNING!: \e[31mMERGE CONFLICT\e[0m";
         echo -e " -> please fix the merge conflict before push it.";
     else
diff --git a/utils/pixel-merge.sh b/utils/pixel-merge.sh
index 88accfb..8cd6286 100755
--- a/utils/pixel-merge.sh
+++ b/utils/pixel-merge.sh
@@ -44,7 +44,7 @@
 
     rm -fr $path;
     echo " -> repo sync ${path}";
-    ret=$(repo sync -d -f --force-sync ${path} 2>&1);
+    ret=$(repo sync -d --force-sync ${path} 2>&1);
     cd $path;
 
     if [[ "${OPERATION}" == "yes" ]]; then
@@ -57,8 +57,10 @@
         ret=$(repo start ${branch_name});
     fi
 
-    # make sure that environment is clean
-    ret=$(git merge --abort 2>&1);
+    if [[ -n "$(git status --porcelain)" ]]; then
+        # make sure that environment is clean
+        ret=$(git merge --abort 2>&1);
+    fi
 
     if [ "${path}" == "hardware/google/pixel-sepolicy" ] ; then
         echo " -> Merging remote: https://android.googlesource.com/platform/$aosp_project ${ref}";
@@ -68,7 +70,7 @@
         ret=$(git pull https://android.googlesource.com/$aosp_project ${ref} 2>&1);
     fi
 
-    if echo $ret | grep "CONFLICT (content)" > /dev/null ; then
+    if [[ -n "$(git status --porcelain)" ]]; then
         echo -e " -> \e[33mWARNING!: \e[31mMERGE CONFLICT\e[0m";
         echo -e " -> please fix the merge conflict before push it.";
     else