I’ve tried writing a git update hook that prevents pushing commits that add files with non-ascii filenames similar to the pre-commit hook distributed with git.
The problem is that the server already does some rewriting on the file names before the hook runs. I use git show --pretty="format:" --name-only $rev to get the files in the rev that is being updated but a file that was commited with a non-ascii character shows up as one with escaped codes.
How can I achieve something like that?
The repo has to be configured with
core.quotepath = false. Then the right file-names show up and my hook works as expected.