From 27b7de929fbdd8bde934d098ea47c418f688c464 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 26 Feb 2018 12:58:37 -0400 Subject: 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. --- doc/tips/automatically_adding_metadata/pre-commit-annex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/tips/automatically_adding_metadata/pre-commit-annex') diff --git a/doc/tips/automatically_adding_metadata/pre-commit-annex b/doc/tips/automatically_adding_metadata/pre-commit-annex index 2e07e3bf4..982fcca7d 100755 --- a/doc/tips/automatically_adding_metadata/pre-commit-annex +++ b/doc/tips/automatically_adding_metadata/pre-commit-annex @@ -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 -- cgit v1.2.3