Fix metadata hook script to support non-ascii characters
tips/automatically_adding_metadata/pre-commit-annex: Fix to not silently skip filenames containing non-ascii characters. git diff-index defaults to munging non-ascii characters. Using -z makes it not do that, and then we just change the nulls to newlines. This commit was sponsored by Jochen Bartl on Patreon.
This commit is contained in:
parent
48819cb92b
commit
42f154bd7e
3 changed files with 6 additions and 1 deletions
|
@ -112,7 +112,7 @@ if [ -n "$*" ]; then
|
|||
process "$f"
|
||||
done
|
||||
else
|
||||
git diff-index --name-only --cached $against | while read f; do
|
||||
git diff-index -z --name-only --cached $against | sed 's/\x00/\n/g' | while read f; do
|
||||
process "$f"
|
||||
done
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue