Skip to content

Commit b1fcd8c

Browse files
Skip files under .git when checking all files
The current 'find $gitroot' solution to check all files examines all the .git meta files as well. These will never match, and on a large repo can be time consuming to skip. This patch excludes them from the find output.
1 parent f6c2d84 commit b1fcd8c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ SAVEIFS=$IFS
5757
IFS=$(echo -en "\n\b")
5858

5959
if [ $CHECK_ALL ]; then
60-
files_to_check=$(find $git_root)
60+
files_to_check=$(find $git_root -path $git_root/.git -prune -o -print)
6161
else
6262
files_to_check=$(git diff --cached --name-only --diff-filter=ACM)
6363
fi

0 commit comments

Comments
 (0)