Always run PolyGerrit lint on merge commits

Merge commits may pull in changes that are not explicitly
listed as part of the merge but are coming from earlier
branches and did not cause any conflict.

Always run PolyGerrit lint when a merge commit is detected,
as the process is not part of the critical path of the build
and it would make sure that no un-checked code is pulled
when the merge commit is submitted.

Bug: Issue 13143
Change-Id: Icd126693b39d113139fac7070c9fe92603be76bd
diff --git a/jenkins/gerrit-codestyle-polygerrit-lint.sh b/jenkins/gerrit-codestyle-polygerrit-lint.sh
index 0a9078b..91a5fef 100644
--- a/jenkins/gerrit-codestyle-polygerrit-lint.sh
+++ b/jenkins/gerrit-codestyle-polygerrit-lint.sh
@@ -5,8 +5,9 @@
     [ "$TARGET_BRANCH" == "stable-3.2" ] || \
     [ "$TARGET_BRANCH" == "stable-3.1" ] || \
     [ "$TARGET_BRANCH" == "stable-3.0" ] || \
-    [ "$TARGET_BRANCH" == "stable-2.16" ]) \
-    && git show --diff-filter=AM --name-only --pretty="" HEAD | grep polygerrit-ui
+    [ "$TARGET_BRANCH" == "stable-2.16" ]) && \
+   ((git show --diff-filter=AM --name-only --pretty="" HEAD | grep polygerrit-ui) || \
+    (git show --summary HEAD | grep -q ^Merge:))
 then
   echo 'Running PolyGerrit lint check...'
   . set-java.sh 8