From 99bb0d975c91f4fffa541b1b149753bc74555e81 Mon Sep 17 00:00:00 2001 From: AlexF <3ndwind@163.com> Date: Wed, 30 May 2018 18:45:32 +0800 Subject: [PATCH] do not need -d'^I' argument for cut command, it's easy input wrong char for invisible char without copying (#1271) --- tools/git-pre-commit-cppcheck | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/git-pre-commit-cppcheck b/tools/git-pre-commit-cppcheck index 4a542d207..8211b22b4 100644 --- a/tools/git-pre-commit-cppcheck +++ b/tools/git-pre-commit-cppcheck @@ -38,7 +38,7 @@ fi # We should pass only added or modified C/C++ source files to cppcheck. changed_files=$(git diff-index --cached $against | \ - grep -E '[MA] .*\.(c|cpp|cc|cxx)$' | cut -d' ' -f 2) + grep -E '[MA] .*\.(c|cpp|cc|cxx)$' | cut -f 2) if [ -n "$changed_files" ]; then cppcheck --error-exitcode=1 $changed_files