From ff5e2b7f4370d7fe1fd0aa9febb1291bb9885028 Mon Sep 17 00:00:00 2001 From: Dennis Liu Date: Mon, 3 Mar 2025 22:40:13 +0800 Subject: [PATCH] Change 'commit_msg_lines' to 'COMMIT_MSG_LINES' The functionality introduced in commit d39d920 was broken due to changes introduced in commit 4a8b8d5, where some occurrences of 'COMMIT_MSG_LINES' were replaced with 'commit_msg_lines' without updating all relevant functions. This commit fixes the issue by replacing all instances of 'commit_msg_lines' with 'COMMIT_MSG_LINES', ensuring consistency and restoring the intended functionality. Change-Id: I0c93617be83c5f24b1e17678566883c0481ddc48 --- scripts/commit-msg.hook | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/commit-msg.hook b/scripts/commit-msg.hook index 498cc7680..d7b42102c 100755 --- a/scripts/commit-msg.hook +++ b/scripts/commit-msg.hook @@ -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