fix hook to only apply to C code
authorChristian Grothoff <christian@grothoff.org>
Sat, 5 Oct 2019 12:56:50 +0000 (14:56 +0200)
committerChristian Grothoff <christian@grothoff.org>
Sat, 5 Oct 2019 12:56:50 +0000 (14:56 +0200)
contrib/uncrustify_precommit

index a370277cce2f303202fe4ce1fc669089b1cafee2..bfea103043f652b56bccf865f07f4db9d9c94c53 100755 (executable)
@@ -10,19 +10,19 @@ crustified=""
 
 for f in $changed;
 do
-  # compare result of uncrustify with changes
-  #
-  # only change any of the invocations here if
-  # they are portable across all cmp and shell
-  # implementations !
-  uncrustify - q - c uncrustify.cfg - f $f | cmp - s $f -
-  if test $? = 1 ;
-  then
-      if echo $f | grep \\.[c,h]\$ > /dev/null
-      then
-        crustified=" $crustified $f"
-        RET=1
-      fi
+ if echo $f | grep \\.[c,h]\$ > /dev/null
+ then
+    # compare result of uncrustify with changes
+    #
+    # only change any of the invocations here if
+    # they are portable across all cmp and shell
+    # implementations !
+    uncrustify - q - c uncrustify.cfg - f $f | cmp - s $f -
+    if test $? = 1 ;
+    then
+      crustified=" $crustified $f"
+      RET=1
+    fi
   fi
 done