Skip to content

Commit

Permalink
Diff against upstream/master (if available) in the format checker scr…
Browse files Browse the repository at this point in the history
…ipt (flutter#5772)

upstream/master represents the tip of tree in local engine repositories
configured based on https://github.com/flutter/engine/blob/master/CONTRIBUTING.md
  • Loading branch information
jason-simmons authored Jul 16, 2018
1 parent d0b8a10 commit 7d15db6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion travis/format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ $CLANG_FORMAT --version
# Compute the diffs.
FILETYPES="*.c *.cc *.cpp *.h *.m *.mm"
DIFF_OPTS="-U0 --no-color --name-only"
FILES_TO_CHECK="$(git diff $DIFF_OPTS master -- $FILETYPES)"
if git remote get-url upstream >/dev/null 2>&1; then
UPSTREAM=upstream/master
else
UPSTREAM=master
fi;
FILES_TO_CHECK="$(git diff $DIFF_OPTS $UPSTREAM -- $FILETYPES)"

FAILED_CHECKS=0
for f in $FILES_TO_CHECK; do
Expand Down

0 comments on commit 7d15db6

Please sign in to comment.