git-hooks: show length of first line if it's too long

Change-Id: I164e4308c2a3e685bbc83cfde1cae5189839075e
Reviewed-on: https://gerrit.libreoffice.org/73556
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
This commit is contained in:
Miklos Vajna
2019-06-05 11:56:32 +02:00
parent 722041b43b
commit 058c54d540

View File

@@ -41,8 +41,9 @@ fi
# ...and that it is not too long
if [ "`head -n 1 $1 | wc -c`" -gt 79 ] ; then
abort "$1" "The first line is too long, please try to fit into 79 characters."
len="`head -n 1 $1 | wc -c`"
if [ "$len" -gt 79 ] ; then
abort "$1" "The first line is $len characters, please try to fit into 79 characters."
fi
fdo_regex='fdo#[0-9]+'