blob: 53020e59bf5b34f9af7b1378954740e60a972b16 [file] [log] [blame]
#!/bin/bash
MERGE_BASE=$(git merge-base master HEAD)
FORMAT_MSG=$(git clang-format $MERGE_BASE -q --diff -- src/)
if [ -n "$FORMAT_MSG" -a "$FORMAT_MSG" != "no modified files to format" ]
then
echo "Run git clang-format before committing!"
echo
# Run git clang-format once again to show the error
git clang-format $MERGE_BASE -q --diff -- src/
exit 1
fi