summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xutil/lint/lint-stable-022-clang-format (renamed from util/lint/lint-022-clang-format)6
1 files changed, 5 insertions, 1 deletions
diff --git a/util/lint/lint-022-clang-format b/util/lint/lint-stable-022-clang-format
index 932d9c0d50..bd662e472f 100755
--- a/util/lint/lint-022-clang-format
+++ b/util/lint/lint-stable-022-clang-format
@@ -30,5 +30,9 @@ if [ -z "$files_to_check" ]; then
fi
if [ $(clang-format $files_to_check | wc -l) -gt 0 ]; then
- git diff HEAD~..HEAD -- $files_to_check | clang-format-diff
+ if [ "$(git diff --no-prefix HEAD~..HEAD -- $files_to_check | clang-format-diff)" != "" ]; then
+ echo "Coding style mismatch. The following patch fixes it:"
+ git diff --no-prefix HEAD~..HEAD -- $files_to_check | clang-format-diff
+ exit 1
+ fi
fi