123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- #!/bin/bash
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PATH=$PATH:/usr/local/bin:/usr/local/sbin
-
-
- exec 1>&2
- test $SKIP_UNCRUSTIFY && exit 0
-
- RET=0
- files=$(bin/uncrustify.sh --filter $(git diff --cached --name-only))
- MSGS=
- for file in $files; do
- if ! bin/uncrustify.sh --check-file $file; then
- MSGS="$MSGS
- bin/uncrustify.sh \"$file\" && git add \"$file\""
- RET=1
- fi
- done
-
- if [[ $RET = 1 ]]; then
- echo "Commit aborted because style fix-ups are required."
- echo "Please run:$MSGS"
- echo "Alternatively, run \"$PWD/bin/uncrustify.sh --staged\" and then re-stage affected files."
- fi
-
- exit $RET
|