Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit af1748b

Browse files
jherlandjrn
authored andcommitted
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 <[email protected]> Signed-off-by: Jonathan Nieder <[email protected]>
1 parent debce6a commit af1748b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

templates/hooks--pre-commit.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ else
1616
fi
1717

1818
# 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)
2020

2121
# Redirect output to stderr.
2222
exec 1>&2

0 commit comments

Comments
 (0)