|
@@ -8,8 +8,10 @@ if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
|
|
# We fetch upstream to ensure that we have the proper references to resolve.
|
|
# We fetch upstream to ensure that we have the proper references to resolve.
|
|
# Ideally we would use $TRAVIS_COMMIT_RANGE but it doesn't play well with PR
|
|
# Ideally we would use $TRAVIS_COMMIT_RANGE but it doesn't play well with PR
|
|
# updates, as it only includes changes since the previous state of the PR.
|
|
# updates, as it only includes changes since the previous state of the PR.
|
|
- git remote add upstream https://github.com/godotengine/godot \
|
|
|
|
- --no-tags -f -t $TRAVIS_BRANCH
|
|
|
|
|
|
+ if [ -z "$(git remote | grep upstream)" ]; then
|
|
|
|
+ git remote add upstream https://github.com/godotengine/godot \
|
|
|
|
+ --no-tags -f -t $TRAVIS_BRANCH
|
|
|
|
+ fi
|
|
RANGE="upstream/$TRAVIS_BRANCH HEAD"
|
|
RANGE="upstream/$TRAVIS_BRANCH HEAD"
|
|
else
|
|
else
|
|
# Test only the last commit, since $TRAVIS_COMMIT_RANGE wouldn't support
|
|
# Test only the last commit, since $TRAVIS_COMMIT_RANGE wouldn't support
|
|
@@ -41,6 +43,6 @@ fi
|
|
# a patch has been created, notify the user and exit
|
|
# a patch has been created, notify the user and exit
|
|
printf "\n*** The following differences were found between the code to commit "
|
|
printf "\n*** The following differences were found between the code to commit "
|
|
printf "and the clang-format rules:\n\n"
|
|
printf "and the clang-format rules:\n\n"
|
|
-cat "$patch"
|
|
|
|
|
|
+pygmentize -l diff "$patch"
|
|
printf "\n*** Aborting, please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\n"
|
|
printf "\n*** Aborting, please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\n"
|
|
exit 1
|
|
exit 1
|