From 95ee1fe61d3623b2d07f1806520de591536976f2 Mon Sep 17 00:00:00 2001 From: Gaƫtan Gilbert Date: Tue, 16 Jan 2018 15:14:55 +0100 Subject: pre-commit hook: fix whitespace error detection --quiet implies --exit-code --- dev/tools/pre-commit | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'dev/tools/pre-commit') diff --git a/dev/tools/pre-commit b/dev/tools/pre-commit index 7718b26d56..ce8bc67df2 100755 --- a/dev/tools/pre-commit +++ b/dev/tools/pre-commit @@ -4,9 +4,7 @@ set -e -# NB: even though we use --cached it seems to exit code 1 with -# unstaged whitespace errors. That just means they get fixed though. -if git diff-index --check --cached HEAD --quiet; +if git diff-index --check --cached HEAD >/dev/null 2>&1 ; then : else -- cgit v1.2.3