diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 7b82f95f..74a2b3f2 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -12,7 +12,7 @@ fi files=() -for file in $(git diff --name-only --cached); do +for file in $(git diff --diff-filter=d --name-only --cached); do if [ ${file: -3} == ".rs" ]; then rustfmt +nightly --check $file &>/dev/null if [ $? != 0 ]; then