1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
samba-mirror/script/git-hooks/check-trailing-whitespace
Andreas Schneider 22eb76c6d0 script: Reformat shell scripts
shfmt -f script/ | xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2022-03-03 00:59:34 +00:00

18 lines
383 B
Bash
Executable File

#!/bin/sh
git diff-index --cached --check HEAD -- :/*.[ch] :/*.p[ylm]
if [ $? != 0 ]; then
echo
echo "The commit failed because it seems to introduce trailing whitespace"
echo "into C, Perl, or Python code."
echo
echo "If you are sure you want to do this, repeat the commit with the "
echo "--no-verify, like this:"
echo
echo " git commit --no-verify"
exit 1
fi
exit 0