Merge pull request #5542 from leoetlino/lint-fix

Tools/Lint: Allow diffing against arbitrary revisions
This commit is contained in:
shuffle2 2017-06-04 17:30:06 -07:00 committed by GitHub
commit b4e5dc6c0f
1 changed files with 4 additions and 1 deletions

View File

@ -4,8 +4,11 @@
fail=0
# Default to staged files, unless a commit was passed.
COMMIT=${1:---cached}
# Loop through each modified file.
for f in $(git diff --name-only --diff-filter=ACMRTUXB --cached); do
for f in $(git diff --name-only --diff-filter=ACMRTUXB $COMMIT); do
# Filter them.
if ! echo "${f}" | egrep -q "[.](cpp|h|mm)$"; then
continue