]> git.r.bdr.sh - rbdr/ngx_http_office_hours_filter_module/blob - scripts/git-hooks/pre-commit
Auto-add C files if they were formatted
[rbdr/ngx_http_office_hours_filter_module] / scripts / git-hooks / pre-commit
1 #!/usr/bin/env sh
2
3 SOURCES=$(git diff --cached --name-only --diff-filter=ACMR | grep -E "\.c$")
4
5 set -e
6 make format
7
8 for SOURCE in ${SOURCES}; do
9 git add ${SOURCE}
10 done