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.)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user