Update hooks.py

Added --diff-filter to ignore deleted files.
This commit is contained in:
Rob Hudson 2013-04-02 15:41:43 -07:00
parent 57417b435a
commit 0f90a8aca5

View file

@ -31,7 +31,7 @@ def git_hook(complexity=-1, strict=False, ignore=None, lazy=False):
the files to the index before running a commit, e.g., git commit -a
:returns: total number of errors if strict is True, otherwise 0
"""
gitcmd = "git diff-index --cached --name-only HEAD"
gitcmd = "git diff-index --cached --name-only --diff-filter=ACMRTUXB HEAD"
if lazy:
# Catch all files, including those not added to the index
gitcmd = gitcmd.replace('--cached ', '')