1515 against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
1616fi
1717
18- # If you want to allow non-ascii filenames set this variable to true.
18+ # If you want to allow non-ASCII filenames set this variable to true.
1919allownonascii=$( git config hooks.allownonascii)
2020
2121# Redirect output to stderr.
2222exec 1>&2
2323
24- # Cross platform projects tend to avoid non-ascii filenames; prevent
24+ # Cross platform projects tend to avoid non-ASCII filenames; prevent
2525# them from being added to the repository. We exploit the fact that the
2626# printable range starts at the space character and ends with tilde.
2727if [ " $allownonascii " != " true" ] &&
@@ -31,18 +31,17 @@ if [ "$allownonascii" != "true" ] &&
3131 test $( git diff --cached --name-only --diff-filter=A -z $against |
3232 LC_ALL=C tr -d ' [ -~]\0' | wc -c) ! = 0
3333then
34- echo " Error: Attempt to add a non-ascii file name."
35- echo
36- echo " This can cause problems if you want to work"
37- echo " with people on other platforms."
38- echo
39- echo " To be portable it is advisable to rename the file ..."
40- echo
41- echo " If you know what you are doing you can disable this"
42- echo " check using:"
43- echo
44- echo " git config hooks.allownonascii true"
45- echo
34+ cat << \EOF
35+ Error: Attempt to add a non-ASCII file name.
36+
37+ This can cause problems if you want to work with people on other platforms.
38+
39+ To be portable it is advisable to rename the file.
40+
41+ If you know what you are doing you can disable this check using:
42+
43+ git config hooks.allownonascii true
44+ EOF
4645 exit 1
4746fi
4847
0 commit comments