Skip to content

Commit db1fac9

Browse files
authored
Merge pull request #273 from sysprog21/refine-git-hook
Unset locale when validating directory names
2 parents e427460 + 8c001ee commit db1fac9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: scripts/commit-msg.hook

+1-1
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ validate_commit_message() {
476476

477477
# Alert if the commit message appears to be written in Chinese.
478478
# This pattern matches any Chinese character (common CJK Unified Ideographs).
479-
MISSPELLED_WORDS=$(echo "$FULL_COMMIT_MSG" | grep "[一-龥]")
479+
MISSPELLED_WORDS=$(echo "$FULL_COMMIT_MSG" | LC_ALL=C grep "[一-龥]")
480480
if [ -n "$MISSPELLED_WORDS" ]; then
481481
add_warning 1 "Commit message appears to be written in Chinese: $MISSPELLED_WORDS"
482482
fi

Diff for: scripts/pre-commit.hook

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ RETURN=0
9999

100100
# Disallow non-ASCII characters in workspace path
101101
workspace=$(git rev-parse --show-toplevel)
102-
if echo "$workspace" | grep -q "[一-龥]"; then
102+
if echo "$workspace" | LC_ALL=C grep -q "[一-龥]"; then
103103
throw "The workspace path '$workspace' contains non-ASCII characters."
104104
fi
105105

0 commit comments

Comments
 (0)