precommit - exclude deleted files on git diff
This commit is contained in:
parent
c1da9353e5
commit
4ce0e2377f
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue