diff --git a/flake8/run.py b/flake8/run.py index 7900e56..cd3a1ee 100644 --- a/flake8/run.py +++ b/flake8/run.py @@ -120,7 +120,7 @@ def git_hook(complexity=-1, strict=False): _initpep8() warnings = 0 - _, files_modified, _ = run("git diff-index --name-only HEAD") + _, files_modified, _ = run("git diff-index --cached --name-only HEAD") for filename in files_modified: ext = os.path.splitext(filename)[-1] if ext != '.py':