diff options
author | Chris Smith <toonarmy@phpbb.com> | 2010-04-13 21:46:19 +0100 |
---|---|---|
committer | Chris Smith <toonarmy@phpbb.com> | 2010-04-13 21:46:19 +0100 |
commit | f6dd150ed8a1fca31e1fb52864e22f5ede1b94db (patch) | |
tree | 91bcdebebd8bc80b9cf8e16d4ac73813251b3b4f /git-tools/hooks/pre-commit | |
parent | 03d50a2e83cc631779a7574acd4db8b77f29d547 (diff) | |
parent | 9674214b2ffd3fc98e707ffa8f9b8b9eaef054da (diff) | |
download | forums-f6dd150ed8a1fca31e1fb52864e22f5ede1b94db.tar forums-f6dd150ed8a1fca31e1fb52864e22f5ede1b94db.tar.gz forums-f6dd150ed8a1fca31e1fb52864e22f5ede1b94db.tar.bz2 forums-f6dd150ed8a1fca31e1fb52864e22f5ede1b94db.tar.xz forums-f6dd150ed8a1fca31e1fb52864e22f5ede1b94db.zip |
Merge branch 'p/git-tools' into git-tools
Diffstat (limited to 'git-tools/hooks/pre-commit')
-rwxr-xr-x | git-tools/hooks/pre-commit | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/git-tools/hooks/pre-commit b/git-tools/hooks/pre-commit index 23ab8d6cdb..9719b91746 100755 --- a/git-tools/hooks/pre-commit +++ b/git-tools/hooks/pre-commit @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh # # A hook to disallow php syntax errors to be committed # by running php -l (lint) on them. It requires php-cli @@ -27,7 +27,10 @@ fi error=0 errors="" -IFS=$'\n' +# dash does not support $'\n': +# http://forum.soft32.com/linux2/Bug-409179-DASH-Settings-IFS-work-properly-ftopict70039.html +IFS=' +' # get a list of staged files for line in $(git diff-index --cached --full-index $against) do @@ -59,7 +62,7 @@ do then error=1 # Swap back in correct filenames - errors+=${result//in - on/"$filename"} + errors=$(echo "$errors"; echo "$result" |sed -e "s@in - on@in $filename on@g") fi done unset IFS |