1
0
Fork 0
mirror of synced 2025-09-23 12:18:44 +00:00

precommit - exclude deleted files on git diff

This commit is contained in:
dark64 2020-05-28 12:04:04 +02:00
parent c1da9353e5
commit 4ce0e2377f

View file

@ -12,7 +12,7 @@ fi
files=() 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 if [ ${file: -3} == ".rs" ]; then
rustfmt +nightly --check $file &>/dev/null rustfmt +nightly --check $file &>/dev/null
if [ $? != 0 ]; then if [ $? != 0 ]; then