diff options
Diffstat (limited to 'misc/travis/clang-format.sh')
-rwxr-xr-x | misc/travis/clang-format.sh | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/misc/travis/clang-format.sh b/misc/travis/clang-format.sh index a6585578e1..c917744ece 100755 --- a/misc/travis/clang-format.sh +++ b/misc/travis/clang-format.sh @@ -8,8 +8,10 @@ if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then # 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 # 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" else # 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 printf "\n*** The following differences were found between the code to commit " 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" exit 1 |