1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-05 09:18:06 +03:00
samba-mirror/script/git-hooks/check-trailing-whitespace

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
383 B
Plaintext
Raw Normal View History

#!/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