Skip to content
Snippets Groups Projects
Commit 742118cd authored by Administrator's avatar Administrator Committed by Florian Uhlig
Browse files

Fix format checker

Don't run the format checker in case a file was removed.
parent ce32d13a
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,12 @@ outfile=$2
BASE_COMMIT=${FAIRROOT_FORMAT_BASE:-HEAD}
GIT_CLANG_FORMAT_BIN=${FAIRROOT_GIT_CLANG_FORMAT_BIN:-git-clang-format}
# special case when a file was deleted
# don't run the test in such a case
if [ ! -e $infile ]; then
exit 0
fi
RESULT=$($GIT_CLANG_FORMAT_BIN --commit $BASE_COMMIT --diff $infile --extensions h,hpp,c,C,cpp,cxx,tpl)
if [ "$RESULT" == "no modified files to format" ] || [ "$RESULT" == "clang-format did not modify any files" ]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment