Skip to content

Commit

Permalink
sample pre-commit hook: use --bool when retrieving config var
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
jherland authored and jrn committed Sep 24, 2013
1 parent debce6a commit af1748b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion templates/hooks--pre-commit.sample
Expand Up @@ -16,7 +16,7 @@ else
fi

# If you want to allow non-ASCII filenames set this variable to true.
allownonascii=$(git config hooks.allownonascii)
allownonascii=$(git config --bool hooks.allownonascii)

# Redirect output to stderr.
exec 1>&2
Expand Down

0 comments on commit af1748b

Please sign in to comment.