From 2e7221cd22bd86827edee649b1014b6c4422e68e Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Tue, 24 Dec 2019 15:15:26 +0100 Subject: [PATCH] Style check commit hook: Ensure that formatted files need to be re-added. --- Tools/astyle/check_code_style.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Tools/astyle/check_code_style.sh b/Tools/astyle/check_code_style.sh index b1154911ba..0e96f754d7 100755 --- a/Tools/astyle/check_code_style.sh +++ b/Tools/astyle/check_code_style.sh @@ -16,6 +16,9 @@ if [ -f "$FILE" ]; then if [[ $PX4_ASTYLE_FIX -eq 1 ]]; then ${DIR}/fix_code_style.sh $FILE else + # Make sure this file is not staged for comitting + git reset $FILE + # Provide instructions echo $FILE 'bad formatting, please run "make format" or "./Tools/astyle/fix_code_style.sh' $FILE'"' exit 1 fi