From cb91be8ccd6e9513ea2d23218685fd358becb839 Mon Sep 17 00:00:00 2001 From: Adam Getchell Date: Thu, 21 Apr 2022 12:28:39 -0700 Subject: [PATCH] Check only changed files --- entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 17bca0e..20e90f9 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,8 +4,8 @@ set -e tw_lines="" # Lines containing trailing whitespaces. -# TODO (harupy): Check only changed files. -for file in $(git ls-files | sed -e 's/^/.\//') +# Check only changed files. +for file in $(git ls-files -m | sed -e 's/^/.\//') do lines=$(egrep -rnIH " +$" $file | cut -f-2 -d ":") if [ ! -z "$lines" ]; then