diff options
author | Maxim Uvarov <maxim.uvarov@linaro.org> | 2017-10-26 11:04:30 +0300 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2017-10-30 22:26:45 +0300 |
commit | 387b402c4f2fc0694b6e0fe68ee4be8a2bd42442 (patch) | |
tree | f633ca8a709e52641cddf0148e0930653c90e251 /scripts | |
parent | 3edee38da55876e36f654a5d1a4b87c2ea5b8bfe (diff) |
travis: fix script to check patches to not fail on new branch
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/ci-checkpatches.sh | 22 |
1 files changed, 14 insertions, 8 deletions
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; |