From 3438b55c1a2e9d3a67c62a83e5b242adeff3dc66 Mon Sep 17 00:00:00 2001 From: Christoph Rauch Date: Thu, 14 Jun 2012 14:04:42 +0200 Subject: [PATCH] git_hook: Only check staged changes for compliance --- flake8/run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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':