Test invalid whitespace at end

This commit is contained in:
Dennis Eichhorn 2018-08-11 11:14:00 +02:00
parent dcf1a0b977
commit 25f09e7d5a

View File

@ -1,14 +1,11 @@
#!/bin/bash #!/bin/bash
isValidFileName() { isValidFileName() {
allownonascii="false" if test $(git diff --cached --name-only --diff-filter=A-z "$1" |
if [ "$allownonascii" != "true" ] &&
test $(git diff --cached --name-only --diff-filter=A -z "$1" |
LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
then then
return 0 return 0
fi fi
return 1 return 1
} }