Skip to content

Commit

Permalink
Fix pre-commit hook to see cached files
Browse files Browse the repository at this point in the history
  • Loading branch information
seantalts committed Apr 14, 2018
1 parent 851f2f6 commit f2ac4e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ then
IFS=$'\n'

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

# format the files
echo $files | xargs -n20 -P6 clang-format -i
Expand Down

0 comments on commit f2ac4e9

Please sign in to comment.