mirror of
https://github.com/git/git
synced 2024-09-29 21:27:13 +00:00
Merge branch 'jp/use-diff-index-in-pre-commit-sample'
The sample pre-commit hook that tries to catch introduction of new paths that use potentially non-portable characters did not notice an existing path getting renamed to such a problematic path, when rename detection was enabled. * jp/use-diff-index-in-pre-commit-sample: hooks--pre-commit: detect non-ASCII when renaming
This commit is contained in:
commit
145336ec1d
|
@ -28,7 +28,7 @@ if [ "$allownonascii" != "true" ] &&
|
||||||
# Note that the use of brackets around a tr range is ok here, (it's
|
# Note that the use of brackets around a tr range is ok here, (it's
|
||||||
# even required, for portability to Solaris 10's /usr/bin/tr), since
|
# even required, for portability to Solaris 10's /usr/bin/tr), since
|
||||||
# the square bracket bytes happen to fall in the designated range.
|
# the square bracket bytes happen to fall in the designated range.
|
||||||
test $(git diff --cached --name-only --diff-filter=A -z $against |
|
test $(git diff-index --cached --name-only --diff-filter=A -z $against |
|
||||||
LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
|
LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
|
||||||
then
|
then
|
||||||
cat <<\EOF
|
cat <<\EOF
|
||||||
|
|
Loading…
Reference in a new issue