From 0f90a8aca56dc1dea7065389fde6a24cfc5dfbc5 Mon Sep 17 00:00:00 2001 From: Rob Hudson Date: Tue, 2 Apr 2013 15:41:43 -0700 Subject: [PATCH] Update hooks.py Added --diff-filter to ignore deleted files. --- flake8/hooks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake8/hooks.py b/flake8/hooks.py index 6473c55..235f4b9 100644 --- a/flake8/hooks.py +++ b/flake8/hooks.py @@ -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 ', '')