Skip to content
Permalink
Browse files

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).
  • Loading branch information
jef-n committed Aug 6, 2017
1 parent 4e9dda2 commit 177a017afef77da8aa27d00e596e91f6c161a939
Showing with 4 additions and 3 deletions.
  1. +4 −3 scripts/prepare-commit.sh
@@ -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 :

0 comments on commit 177a017

Please sign in to comment.
You can’t perform that action at this time.