tangled
alpha
login
or
join now
bernsteinbear.com
/
scrapscript
0
fork
atom
this repo has no description
0
fork
atom
overview
issues
pulls
pipelines
Ignore deleted files in git hook
bernsteinbear.com
2 years ago
e6c3b0cf
46fbbb47
+2
-1
1 changed file
expand all
collapse all
unified
split
hooks
pre-commit
+2
-1
hooks/pre-commit
reviewed
···
11
11
against=$(git hash-object -t tree /dev/null)
12
12
fi
13
13
# cat always has error code 0
14
14
-
filenames=$(git diff --cached --name-only $against | grep '\.py$' | cat)
14
14
+
# ignore deleted files (can't be formatted)
15
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