Skip to content

Commit

Permalink
Try to find out which lines don't match.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Dec 7, 2013
1 parent 3c929ac commit b2f28be
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion git-hooks/pre-receive.d/php-syntax-check
Expand Up @@ -21,7 +21,12 @@ function parseDiff($oldrev, $newrev, $diffcmd, $regex)
}

foreach ($diff as $diffline) {
preg_match($regex, $diffline, $matches);
if (!preg_match($regex, $diffline, $matches)) {
printf('Unknown line format "%s" from command call "%s"',
$diffline,
$diffcmd);
continue;
}
$blob = $matches[1];
$filename = $matches[2];

Expand Down

0 comments on commit b2f28be

Please sign in to comment.