mirror of
https://github.com/opnsense/src.git
synced 2026-04-15 14:29:58 -04:00
19 lines
390 B
Text
19 lines
390 B
Text
|
|
#!/bin/sh
|
||
|
|
|
||
|
|
set -e
|
||
|
|
|
||
|
|
# Run clang-format and add modified files
|
||
|
|
MODIFIED_UNSTAGED=$(git -C . diff --name-only)
|
||
|
|
MODIFIED_STAGED=$(git -C . diff --name-only --cached --diff-filter=d)
|
||
|
|
|
||
|
|
./clang-format.sh
|
||
|
|
|
||
|
|
git add ${MODIFIED_STAGED}
|
||
|
|
|
||
|
|
if [[ ${MODIFIED_UNSTAGED} != $(git -C . diff --name-only) ]]; then
|
||
|
|
echo "WARNING: Non-staged files were reformatted. Please review and/or add" \
|
||
|
|
"them"
|
||
|
|
fi
|
||
|
|
|
||
|
|
|