Merge pull request #5542 from leoetlino/lint-fix
Tools/Lint: Allow diffing against arbitrary revisions
This commit is contained in:
commit
b4e5dc6c0f
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue