aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2010-04-09 10:43:54 -0400
committerChris Smith <toonarmy@phpbb.com>2010-04-13 21:44:12 +0100
commit9afe2c9b6e9b414889f8642e719308afa434bc40 (patch)
tree83f95bfcd81b6831bcb23b9f699160cf8862b73f /git-tools/hooks
parent[git-tools] Changed pre-commit hook to use sh instead of bash (diff)
downloadphpbb-9afe2c9b6e9b414889f8642e719308afa434bc40.tar.gz
phpbb-9afe2c9b6e9b414889f8642e719308afa434bc40.tar.bz2
phpbb-9afe2c9b6e9b414889f8642e719308afa434bc40.zip
[git-tools] Adjusted pre-commit hook to run under freebsd /bin/sh.
Diffstat (limited to 'git-tools/hooks')
-rwxr-xr-xgit-tools/hooks/pre-commit7
1 files changed, 5 insertions, 2 deletions
diff --git a/git-tools/hooks/pre-commit b/git-tools/hooks/pre-commit
index 5f75381155..835b28aec3 100755
--- a/git-tools/hooks/pre-commit
+++ b/git-tools/hooks/pre-commit
@@ -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