From ffbd1e02ccbd5aaaa1f0842267802f3a4a9e67ff Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Fri, 15 Jun 2018 00:20:49 -0500 Subject: [PATCH] Avoid \0 delimeter We actually do not need any \0 delimeter because '\n' is an invalid character in file names. So, simply switch to '\n' delimeted output. This helps with Mac OS X compatibility because there grep might not have the -z (--null-data) option and can thus not correctly match null terminated input... --- contrib/utilities/indent_common.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/contrib/utilities/indent_common.sh b/contrib/utilities/indent_common.sh index ea44416af2..0d1f209cea 100644 --- a/contrib/utilities/indent_common.sh +++ b/contrib/utilities/indent_common.sh @@ -189,9 +189,9 @@ process_changed() { LAST_MERGE_COMMIT="$(git log --format="%H" --merges --max-count=1 master)" - ( git ls-files -z --others --exclude-standard -- ${1}; - git diff -z --name-only $LAST_MERGE_COMMIT -- ${1} )| - sort -zu | - grep -zE "^${2}$" | - xargs --no-run-if-empty -0 -n 1 -P 10 -I {} bash -c "${3} {}" + ( git ls-files --others --exclude-standard -- ${1}; + git diff --name-only $LAST_MERGE_COMMIT -- ${1} )| + sort -u | + grep -E "^${2}$" | + xargs --no-run-if-empty -d '\n' -n 1 -P 10 -I {} bash -c "${3} {}" } -- 2.39.5