sample pre-commit hook: use --bool when retrieving config var
Currently if you set [hooks] allowNonAscii (or allownonascii = 1, or = yes) in your .git/config then the sample pre-commit misinterprets the value as "false" and rejects non-ASCII filenames. Use "git config --bool" to get the usual nicer boolean handling. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Johan Herland committed
Sep 24, 2013 at 09:52 UTC
af1748b31eb68643f1b8d9d918f43611cf96d257
1 file changed
+1
-1
templates/hooks--pre-commit.sample
+1
-1
@@ -16,7 +16,7 @@ else
16
fi
17
18
# If you want to allow non-ASCII filenames set this variable to true.
19
-allownonascii=$(git config hooks.allownonascii)
19
+allownonascii=$(git config --bool hooks.allownonascii)
20
21
# Redirect output to stderr.
22
exec 1>&2