Skip to content

Commit

Permalink
Merge branch '3.2.x'
Browse files Browse the repository at this point in the history
* 3.2.x:
  [ticket/15683] Better error message when commit message has CRLF
  • Loading branch information
Nicofuma committed Jul 8, 2018
2 parents 844ecb8 + 18f142e commit 0876a63
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions git-tools/hooks/commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0876a63

Please sign in to comment.