diff --git a/tools/codestyle/pre_commit.sh b/tools/codestyle/pre_commit.sh index e1eb7c9ce9a6a..adc1ce1b54305 100755 --- a/tools/codestyle/pre_commit.sh +++ b/tools/codestyle/pre_commit.sh @@ -29,7 +29,7 @@ if ! [[ $(python -V 2>&1 | awk '{print $2}' | awk -F '.' '{print $1$2}') -ge 36 exit 1 fi -diff_files=$(git diff --numstat ${BRANCH} | awk '{print $NF}') +diff_files=$(git diff --name-only --diff-filter=ACMR ${BRANCH}) num_diff_files=$(echo "$diff_files" | wc -l) echo -e "diff files between pr and ${BRANCH}:\n${diff_files}"