diff --git a/util/lint/lint-022-clang-format b/util/lint/lint-stable-022-clang-format similarity index 79% rename from util/lint/lint-022-clang-format rename to 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