Skip to content

Commit f2ac4e9

Browse files
committed
Fix pre-commit hook to see cached files
1 parent 851f2f6 commit f2ac4e9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hooks/pre-commit

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ then
3737
IFS=$'\n'
3838

3939
echo "Files formatted:"
40-
files=$(git diff --diff-filter=AM --name-only | grep -E ".hpp$|.cpp$" | grep -v "^lib/")
40+
files=$(git diff --cached --diff-filter=AM --name-only | grep -E ".hpp$|.cpp$" | grep -v "^lib/")
4141

4242
# format the files
4343
echo $files | xargs -n20 -P6 clang-format -i

0 commit comments

Comments
 (0)