]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Let run-clang-format always exit with success in non-check mode
authorJoel Rosdahl <joel@rosdahl.net>
Wed, 25 Mar 2020 20:09:00 +0000 (21:09 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Wed, 25 Mar 2020 20:09:00 +0000 (21:09 +0100)
I don’t consider explicit reformatting to be an error.

misc/run-clang-format

index 843e213ffd50f6f229f712e41b0f4dabc3f3e5ba..a59319e40b4b3f20df37fef47867cbdbb0d149a5 100755 (executable)
@@ -38,9 +38,9 @@ if ! cmp -s "$file" "$tmp_file"; then
         git diff $cf_diff_color --no-index "$file" "$tmp_file" |
             sed -r -e "s!^---.*!--- a/$file!" -e "s!^\+\+\+.*!+++ b/$file!" \
             -e "/diff --/d" -e "/index /d" -e "s/.[0-9]*.clang-format.tmp//"
+        exit 1
     else
         echo "Reformatted $file"
         mv "$tmp_file" "$file" && trap '' EXIT
     fi
-    exit 1
 fi