Skip to content

Commit 145336e

Browse files
committed
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
2 parents 425e7f0 + d9fd71f commit 145336e

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
@@ -28,7 +28,7 @@ if [ "$allownonascii" != "true" ] &&
2828
# Note that the use of brackets around a tr range is ok here, (it's
2929
# even required, for portability to Solaris 10's /usr/bin/tr), since
3030
# the square bracket bytes happen to fall in the designated range.
31-
test $(git diff --cached --name-only --diff-filter=A -z $against |
31+
test $(git diff-index --cached --name-only --diff-filter=A -z $against |
3232
LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
3333
then
3434
cat <<\EOF

0 commit comments

Comments
 (0)