mirror of
https://github.com/samba-team/samba.git
synced 2025-03-05 20:58:40 +03:00
script/git-hooks: add check-trailing-whitespace
Signed-off-by: Ralph Boehme <slow at samba.org> Reviewed-by: Martin Schwenke <martin at meltin.net> Reviewed-by: Jeremy Allison <jra at samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Apr 26 03:54:39 CEST 2018 on sn-devel-144
This commit is contained in:
parent
8649e21665
commit
5757d25932
17
script/git-hooks/check-trailing-whitespace
Executable file
17
script/git-hooks/check-trailing-whitespace
Executable file
@ -0,0 +1,17 @@
|
||||
#!/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
|
@ -14,4 +14,6 @@ if [ $? -ne 0 ] ; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
${gitdir}/script/git-hooks/check-trailing-whitespace || exit $?
|
||||
|
||||
exit 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user