diff --git a/.travis.yml b/.travis.yml index 38ecf134b0..005cdc7136 100644 --- a/.travis.yml +++ b/.travis.yml @@ -106,15 +106,7 @@ matrix: - astyle --version script: # only changed files to be checked for astyle - - COMMIT_RANGE=${TRAVIS_COMMIT_RANGE/.../..} - - if [! git diff --quiet "$COMMIT_RANGE" -- ] - then - COMMIT_CONTENT=`git diff-tree --no-commit-id --name-only -r $TRAVIS_COMMIT` - else - COMMIT_CONTENT=`git diff --name-only $COMMIT_RANGE` - fi - - echo $COMMIT_CONTENT - - find -regex '.*\.\(h\|c\|hpp\|cpp\)' -type f | fgrep -v -f .astyleignore | $COMMIT_CONTENT | xargs -n 100 -I {} bash -c "astyle -n --options=.astylerc \"{}\"" > astyle.out; + - git diff --name-only $TRAVIS_BRANCH | grep '.*\.\(h\|c\|hpp\|cpp\)' | fgrep -v -f .astyleignore | xargs -n 100 -I {} bash -c "astyle -n --options=.astylerc \"{}\"" > astyle.out; if [ $(cat astyle.out | grep Formatted | wc -l) -ne 0 ]; then git --no-pager diff; echo "Please fix style issues as shown above";