Corrected simplified astyle job behavior when base branch is not master

Consolidated efforts from PR #9336.

Previous job's env vars would not be populated correctly if the base branch of a PR was not master.
Corected by pulling remaining respository information to perform comparison between read-only instance of PR and base branch.
pull/9346/head
Cruz Monrreal II 2019-01-10 22:28:51 -06:00
parent 28d5477e50
commit 84469e1b6f
1 changed files with 4 additions and 1 deletions

View File

@ -144,9 +144,12 @@ matrix:
export PATH=$PWD/bin:$PATH;
cd -
- astyle --version
# Fetch remaining information needed for branch comparison
- git fetch --all --unshallow --tags
- git fetch origin "${TRAVIS_BRANCH}"
script:
- >-
git diff --name-only --diff-filter=d HEAD..${TRAVIS_BRANCH} \
git diff --name-only --diff-filter=d FETCH_HEAD..HEAD \
| ( grep '.\(c\|cpp\|h\|hpp\)$' || true ) \
| ( fgrep -v -f .astyleignore || true ) \
| while read file; do astyle -n --options=.astylerc "${file}"; done