Skip to content

Commit 3eac8a7

Browse files
committed
Unset locale when validating directory names
This commit resolves the "Invalid collation character" error thrown by 'grep' when validating directory names with special characters. It sets locale to "C" before running 'grep'. Change-Id: Ia005744cfc1799dff0148602bcb99d947f8c805d
1 parent e427460 commit 3eac8a7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/pre-commit.hook

Lines changed: 1 addition & 1 deletion
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)