From: Maxim Uvarov <maxim.uva...@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uva...@linaro.org> --- /** Email created from pull request 263 (muvarov:master_fixscripts) ** https://github.com/Linaro/odp/pull/263 ** Patch: https://github.com/Linaro/odp/pull/263.patch ** Base sha: 3edee38da55876e36f654a5d1a4b87c2ea5b8bfe ** Merge commit sha: 7470cdbf6ae96d7e9842196b4842063fdfb2416c **/ .travis.yml | 1 - scripts/ci-checkpatches.sh | 22 ++++++++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/.travis.yml b/.travis.yml index 2d3971718..7632ae3fe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -279,7 +279,6 @@ jobs: script: - echo ${TRAVIS_COMMIT_RANGE}; - ODP_PATCHES=`echo ${TRAVIS_COMMIT_RANGE} | sed 's/\.//'`; - - if [ -z "${ODP_PATCHES}" ]; then env; exit 0; fi; - ./scripts/ci-checkpatches.sh ${ODP_PATCHES}; after_failure: diff --git a/scripts/ci-checkpatches.sh b/scripts/ci-checkpatches.sh index cb1c4e65d..798efe052 100755 --- a/scripts/ci-checkpatches.sh +++ b/scripts/ci-checkpatches.sh @@ -1,17 +1,23 @@ -#!/bin/bash +#!/bin/bash -x PATCHES=$1 echo "Run checkpatch for ${PATCHES}" # Generate patches provided with $1. # In case of force push and range is broken # validate only the latest commit if it's not merge commit. -git format-patch ${PATCHES} + +if [ "$PATCHES" = "" ]; then + git format-patch -1 HEAD; + perl ./scripts/checkpatch.pl *.patch; + exit $? +fi + +git show --summary HEAD| grep -q '^Merge:'; if [ $? -ne 0 ]; then - git show --summary HEAD| grep -q '^Merge:'; - if [ $? -ne 0 ]; then - git format-patch HEAD^; - perl ./scripts/checkpatch.pl *.patch; - fi; -else + git format-patch -1 HEAD; perl ./scripts/checkpatch.pl *.patch; + exit $? fi + +git format-patch ${PATCHES} +perl ./scripts/checkpatch.pl *.patch;