diff options
Diffstat (limited to 'pre-commit.d/30store-metadata')
-rwxr-xr-x | pre-commit.d/30store-metadata | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pre-commit.d/30store-metadata b/pre-commit.d/30store-metadata index 5190a2c..fbd9096 100755 --- a/pre-commit.d/30store-metadata +++ b/pre-commit.d/30store-metadata @@ -6,9 +6,9 @@ set -e filter_unknown() { CMD=$1 while read line; do - if [ "${line:0:8+${#CMD}}" = "$CMD UNKNOWN" ]; then - # error message like "Bad owner for ./ppp/peers" - echo Bad "$2" for "${line:9+${#CMD}}" >&2 + # if the first n chars of $line equal "$CMD UNKNOWN "... + if [ "$(printf %.$((9+${#CMD}))s "$line")" = "$CMD UNKNOWN " ]; then + echo Bad "$2" for "$line" >&2 else echo "$line" fi |