diff options
Diffstat (limited to 'scripts/ci-checkpatches.sh')
-rwxr-xr-x | scripts/ci-checkpatches.sh | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/scripts/ci-checkpatches.sh b/scripts/ci-checkpatches.sh index cb1c4e65d..4ce077342 100755 --- a/scripts/ci-checkpatches.sh +++ b/scripts/ci-checkpatches.sh @@ -1,17 +1,15 @@ -#!/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 [ $? -ne 0 ]; then - git show --summary HEAD| grep -q '^Merge:'; - if [ $? -ne 0 ]; then - git format-patch HEAD^; - perl ./scripts/checkpatch.pl *.patch; - fi; +# Generate patches provided with $1. If commit range is not available validate +# only the latest commit. + +if [ "$PATCHES" = "" ]; then + git format-patch -1 -M HEAD; else - perl ./scripts/checkpatch.pl *.patch; + git format-patch ${PATCHES} fi + +perl ./scripts/checkpatch.pl *.patch; +exit $? |