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