15
15
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
16
16
fi
17
17
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.
19
19
allownonascii=$( git config hooks.allownonascii)
20
20
21
21
# Redirect output to stderr.
22
22
exec 1>&2
23
23
24
- # Cross platform projects tend to avoid non-ascii filenames; prevent
24
+ # Cross platform projects tend to avoid non-ASCII filenames; prevent
25
25
# them from being added to the repository. We exploit the fact that the
26
26
# printable range starts at the space character and ends with tilde.
27
27
if [ " $allownonascii " != " true" ] &&
@@ -31,18 +31,17 @@ if [ "$allownonascii" != "true" ] &&
31
31
test $( git diff --cached --name-only --diff-filter=A -z $against |
32
32
LC_ALL=C tr -d ' [ -~]\0' | wc -c) ! = 0
33
33
then
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
46
45
exit 1
47
46
fi
48
47
0 commit comments