From 43ea241e7c76cd965872e32cf8f4ddfa87ccd39e Mon Sep 17 00:00:00 2001 From: io Date: Fri, 19 Jan 2018 23:39:31 +0100 Subject: [PATCH] check-pol calls dn42-schema with invalid args if filter.txt has been edited There's no need to validate $LINE[1] if $LINE[2] is nonempty. (Except if git emits a path with "//", but I don't think this can happen.) --- check-pol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check-pol b/check-pol index 4b5cc826c..98cf75cbd 100755 --- a/check-pol +++ b/check-pol @@ -12,7 +12,7 @@ BASE="$(dirname "$BASE")" cd "$BASE" || exit 1 git diff --name-only $1 | while IFS='/' read -ra LINE; do -if [[ "${LINE[0]}" = "data" ]]; then +if [[ "${LINE[0]}" = "data" && -n "${LINE[2]}" ]]; then utils/schema-check/dn42-schema.py -v policy ${LINE[1]} ${LINE[2]} $2 fi done