diff options
author | Tristan Darricau <tristan.darricau@gmail.com> | 2018-07-08 18:47:37 +0200 |
---|---|---|
committer | Tristan Darricau <tristan.darricau@gmail.com> | 2018-07-08 18:47:37 +0200 |
commit | 18f142e87dd1a4e5f3d1f416cba7dfabfdbb5ec4 (patch) | |
tree | 7adee92ae25ae616e265d469de85e1c572c0044c /git-tools/hooks | |
parent | 3d9ae6186f1e51662ab7a4c9ce1fbae9e1c0352a (diff) | |
parent | 90689090513fb3285b12eb0c9cda87c4125ded86 (diff) | |
download | forums-18f142e87dd1a4e5f3d1f416cba7dfabfdbb5ec4.tar forums-18f142e87dd1a4e5f3d1f416cba7dfabfdbb5ec4.tar.gz forums-18f142e87dd1a4e5f3d1f416cba7dfabfdbb5ec4.tar.bz2 forums-18f142e87dd1a4e5f3d1f416cba7dfabfdbb5ec4.tar.xz forums-18f142e87dd1a4e5f3d1f416cba7dfabfdbb5ec4.zip |
Merge pull request #5239 from avijc/ticket/15683
[ticket/15683] Better error message when commit message has CRLF
* github.com:/phpbb/phpbb:
[ticket/15683] Better error message when commit message has CRLF
Diffstat (limited to 'git-tools/hooks')
-rwxr-xr-x | git-tools/hooks/commit-msg | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/git-tools/hooks/commit-msg b/git-tools/hooks/commit-msg index 136606252c..b73005b34d 100755 --- a/git-tools/hooks/commit-msg +++ b/git-tools/hooks/commit-msg @@ -147,6 +147,15 @@ then quit $ERR_LENGTH; fi +# Check for CR/LF line breaks +if grep -q $'\r$' "$1" +then + complain "The commit message uses CR/LF line breaks, which are not permitted." >&2 + complain >&2 + + quit $ERR_EOF; +fi + lines=$(wc -l "$1" | awk '{ print $1; }'); expecting=header; in_description=0; |