prepare-commit.sh: when run as pre-commit hook use /dev/tty. And don't

generally complain about trailing whitespaces as we have cases where
that's fine (and hence are excluded from astyle).
This commit is contained in:
Juergen E. Fischer 2017-08-06 14:10:28 +02:00
parent 4e9dda237e
commit 177a017afe

View File

@ -18,6 +18,10 @@ TOPLEVEL=$(git rev-parse --show-toplevel)
PATH=$TOPLEVEL/scripts:$PATH
if ! tty -s && [[ "$0" =~ /pre-commit ]]; then
exec </dev/tty
fi
cd $TOPLEVEL
# GNU prefix command for mac os support (gsed, gsplit)
@ -142,9 +146,6 @@ if [ -s "$ASTYLEDIFF" ]; then
exit 1
fi
# If there are whitespace errors, print the offending file names and fail.
exec git diff-index --check --cached HEAD --
exit 0
# vim: set ts=2 expandtab :