add git diff filter (#6484)
authorCody Yu <comaniac0422@gmail.com>
Tue, 15 Sep 2020 20:19:59 +0000 (13:19 -0700)
committerGitHub <noreply@github.com>
Tue, 15 Sep 2020 20:19:59 +0000 (13:19 -0700)
tests/lint/git-black.sh

index b72a613..835c30d 100755 (executable)
@@ -46,7 +46,7 @@ fi
 echo "Version Information: $(black --version)"
 
 # Compute Python files which changed to compare.
-IFS=$'\n' read -a FILES -d'\n' < <(git diff --name-only $1 -- "*.py" "*.pyi") || true
+IFS=$'\n' read -a FILES -d'\n' < <(git diff --name-only --diff-filter=ACMRTUX $1 -- "*.py" "*.pyi") || true
 echo "Read returned $?"
 if [ -z ${FILES+x} ]; then
     echo "No changes in Python files"