Commit 6c7e3f42 authored by Brad King's avatar Brad King
Browse files

commit-msg: Reject leading or trailing space on first line

parent 1387c7ef
......@@ -38,6 +38,10 @@ msg_first() {
------------------------------------------------------------------------------
'"$line"'
------------------------------------------------------------------------------
'
elif echo "$line" | grep "^[ ]\|[ ]$" >/dev/null 2>&1; then
die 'The first line may not have leading or trailing space:
['"$line"']
'
else
# first line okay
......@@ -61,7 +65,7 @@ msg_rest() {
# Pipe commit message into the state machine.
state=first
cat "$commit_msg" |
while read line; do
while IFS='' read line; do
msg_$state || break
done &&
rm -f "$commit_msg"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment