From: Christian Grothoff Date: Sat, 5 Oct 2019 12:56:50 +0000 (+0200) Subject: fix hook to only apply to C code X-Git-Tag: v0.11.7~95 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=5a065f662988dfd0e5295ba5006bda1927c82763;p=oweals%2Fgnunet.git fix hook to only apply to C code --- diff --git a/contrib/uncrustify_precommit b/contrib/uncrustify_precommit index a370277cc..bfea10304 100755 --- a/contrib/uncrustify_precommit +++ b/contrib/uncrustify_precommit @@ -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