this repo has no description

Ignore deleted files in git hook

+2 -1
+2 -1
hooks/pre-commit
··· 11 11 against=$(git hash-object -t tree /dev/null) 12 12 fi 13 13 # cat always has error code 0 14 - filenames=$(git diff --cached --name-only $against | grep '\.py$' | cat) 14 + # ignore deleted files (can't be formatted) 15 + filenames=$(git diff --cached --name-only --diff-filter=d $against | grep '\.py$' | cat) 15 16 if [ -n "$filenames" ] 16 17 then 17 18 ./scrapscript.py test