]> git.r.bdr.sh - rbdr/ngx_http_office_hours_filter_module/blame - 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
CommitLineData
17a7fd4f
BB
1#!/usr/bin/env sh
2
47ec1556
BB
3SOURCES=$(git diff --cached --name-only --diff-filter=ACMR | grep -E "\.c$")
4
5set -e
17a7fd4f 6make format
47ec1556
BB
7
8for SOURCE in ${SOURCES}; do
9 git add ${SOURCE}
10done