Martin Roth | 0ad5fbd | 2020-12-24 12:06:38 -0700 | [diff] [blame] | 1 | #!/usr/bin/env sh |
Martin Roth | e99a718 | 2018-06-06 21:34:47 -0600 | [diff] [blame] | 2 | # |
Patrick Georgi | 7333a11 | 2020-05-08 20:48:04 +0200 | [diff] [blame] | 3 | # SPDX-License-Identifier: GPL-2.0-only |
| 4 | |
Martin Roth | e99a718 | 2018-06-06 21:34:47 -0600 | [diff] [blame] | 5 | # DESCR: Check for illegal characters in filename |
| 6 | |
| 7 | LC_ALL=C export LC_ALL |
| 8 | |
| 9 | # Skip check if git isn't available |
| 10 | if [ -n "$(command -v git)" ] && \ |
| 11 | [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ] |
| 12 | then |
| 13 | git ls-files | grep "[^A-Za-z0-9/_\.-]" |
| 14 | fi |