X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a92d7b716f51a53dea7f59db8524d4add713b910..0342cac8cbf7d74cf6efa11b33abd8cb6d87cc3c:/tools/git-hooks/clang-format.pre-commit diff --git a/tools/git-hooks/clang-format.pre-commit b/tools/git-hooks/clang-format.pre-commit index 9a6678b269..db2e47aad2 100755 --- a/tools/git-hooks/clang-format.pre-commit +++ b/tools/git-hooks/clang-format.pre-commit @@ -149,7 +149,9 @@ do # +++ - timestamp # to both lines working on the same file and having a a/ and b/ prefix. # Else it can not be applied with 'git apply'. - git ${GIT_SUBCOMMAND} --binary ${CLANG_FORMAT} --diff -q "$file" >> "$patch" + git ${GIT_SUBCOMMAND} --binary ${CLANG_FORMAT} --diff -q "$file" \ + | (grep -v "no modified files to format"||true) \ + >> "$patch" #"$CLANG_FORMAT" -style=file "$file" | \ #diff -u "$file" - | \ #sed -e "1s|--- |--- a/|" -e "2s|+++ -|+++ b/$file|" >> "$patch"