mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-08 00:05:09 -04:00
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:
parent
4e9dda237e
commit
177a017afe
@ -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 :
|
||||
|
Loading…
x
Reference in New Issue
Block a user