mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
Merge branch 'p/git-tools' into git-tools
This commit is contained in:
commit
f6dd150ed8
1 changed files with 6 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# A hook to disallow php syntax errors to be committed
|
# A hook to disallow php syntax errors to be committed
|
||||||
# by running php -l (lint) on them. It requires php-cli
|
# by running php -l (lint) on them. It requires php-cli
|
||||||
|
@ -27,7 +27,10 @@ fi
|
||||||
error=0
|
error=0
|
||||||
errors=""
|
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
|
# get a list of staged files
|
||||||
for line in $(git diff-index --cached --full-index $against)
|
for line in $(git diff-index --cached --full-index $against)
|
||||||
do
|
do
|
||||||
|
@ -59,7 +62,7 @@ do
|
||||||
then
|
then
|
||||||
error=1
|
error=1
|
||||||
# Swap back in correct filenames
|
# 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
|
fi
|
||||||
done
|
done
|
||||||
unset IFS
|
unset IFS
|
||||||
|
|
Loading…
Add table
Reference in a new issue