aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'git-tools/hooks/pre-commit')
-rwxr-xr-xgit-tools/hooks/pre-commit8
1 files changed, 7 insertions, 1 deletions
diff --git a/git-tools/hooks/pre-commit b/git-tools/hooks/pre-commit
index 5be33fb9a1..a0c2b6b247 100755
--- a/git-tools/hooks/pre-commit
+++ b/git-tools/hooks/pre-commit
@@ -73,7 +73,13 @@ do
# check the staged file content for syntax errors
# using php -l (lint)
- result=$(git cat-file -p $sha | "$PHP_BIN" -l 2>/dev/null)
+ # note: if display_errors=stderr in php.ini,
+ # parse errors are printed on stderr; otherwise
+ # they are printed on stdout.
+ # we filter everything other than parse errors
+ # with a grep below, therefore it should be safe
+ # to combine stdout and stderr in all circumstances
+ result=$(git cat-file -p $sha | "$PHP_BIN" -l 2>&1)
if [ $? -ne 0 ]
then
error=1