Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions scripts/commit-msg.hook
Original file line number Diff line number Diff line change
Expand Up @@ -360,15 +360,15 @@ validate_commit_message() {
URL_REGEX='^[[:blank:]]*(https?|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]*[-A-Za-z0-9+&@#/%=~_|]'

# Ensure the commit message lines are loaded into an array.
readarray -t commit_msg_lines < "$COMMIT_MSG_FILE"
readarray -t COMMIT_MSG_LINES < "$COMMIT_MSG_FILE"

for i in "${!commit_msg_lines[@]}"; do
for i in "${!COMMIT_MSG_LINES[@]}"; do
# Skip the first line (the subject) since the limit applies to the body.
if [ "$i" -eq 0 ]; then
continue
fi

line="${commit_msg_lines[$i]}"
line="${COMMIT_MSG_LINES[$i]}"

# Skip lines that are comments.
if [[ "$line" =~ ^[[:space:]]*# ]]; then
Expand Down
Loading