mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-09 19:26:53 +02:00
[ticket/9824] Handle empty commit messages in commit-msg hook.
Git already handles the case of commit message being empty by aborting the commit and displaying a reasonably helpful message. If there is no commit message, the hook will exit with success exit code to let git do its thing. PHPBB3-9824
This commit is contained in:
@ -55,6 +55,17 @@ quit()
|
||||
fi
|
||||
}
|
||||
|
||||
# Check for empty commit message
|
||||
if ! grep -qv '^#' "$1"
|
||||
then
|
||||
# Commit message is empty (or contains only comments).
|
||||
# Let git handle this.
|
||||
# It will abort with a message like so:
|
||||
#
|
||||
# Aborting commit due to empty commit message.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
msg=$(grep -nE '.{81,}' "$1");
|
||||
|
||||
if [ $? -eq 0 ]
|
||||
|
Reference in New Issue
Block a user