File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -344,8 +344,11 @@ validate_commit_message() {
344344 add_warning 1 " Commit message appears to be written in Chinese: $MISSPELLED_WORDS "
345345 fi
346346
347- # Remove quoted text from FULL_COMMIT_MSG for spell checking.
348- MSG_FOR_SPELLCHECK=$( echo " $FULL_COMMIT_MSG " | sed -E " s/(['\" ][^'\" ]*['\" ])//g" )
347+ # Remove quoted text and commit hashes from $FULL_COMMIT_MSG for spell checking.
348+ # Handles commit references like "commit 7d05741" (short) or full 40-char hashes.
349+ MSG_FOR_SPELLCHECK=$( echo " $FULL_COMMIT_MSG " | sed -E \
350+ -e " s/(['\" ][^'\" ]*['\" ])//g" \
351+ -e " s/\bcommit[[:space:]]+[0-9a-fA-F]{7,40}\b/commit/g" )
349352
350353 # Use aspell to list misspelled words according to American English, ignoring quoted text.
351354 MISSPELLED_WORDS=$( echo " $MSG_FOR_SPELLCHECK " | $ASPELL --lang=en --list --home-dir=scripts --personal=aspell-pws)
You can’t perform that action at this time.
0 commit comments