diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-10-05 14:56:50 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-10-05 14:56:50 +0200 |
commit | 5a065f662988dfd0e5295ba5006bda1927c82763 (patch) | |
tree | 69f7204c6dfc7372837431167484842ca425afbb /contrib/uncrustify_precommit | |
parent | dda0c6ca7ed369fdacbece6a04ac6cc250319a7f (diff) | |
download | gnunet-5a065f662988dfd0e5295ba5006bda1927c82763.tar.gz gnunet-5a065f662988dfd0e5295ba5006bda1927c82763.zip |
fix hook to only apply to C code
Diffstat (limited to 'contrib/uncrustify_precommit')
-rwxr-xr-x | contrib/uncrustify_precommit | 26 |
1 files changed, 13 insertions, 13 deletions
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="" | |||
10 | 10 | ||
11 | for f in $changed; | 11 | for f in $changed; |
12 | do | 12 | do |
13 | # compare result of uncrustify with changes | 13 | if echo $f | grep \\.[c,h]\$ > /dev/null |
14 | # | 14 | then |
15 | # only change any of the invocations here if | 15 | # compare result of uncrustify with changes |
16 | # they are portable across all cmp and shell | 16 | # |
17 | # implementations ! | 17 | # only change any of the invocations here if |
18 | uncrustify - q - c uncrustify.cfg - f $f | cmp - s $f - | 18 | # they are portable across all cmp and shell |
19 | if test $? = 1 ; | 19 | # implementations ! |
20 | then | 20 | uncrustify - q - c uncrustify.cfg - f $f | cmp - s $f - |
21 | if echo $f | grep \\.[c,h]\$ > /dev/null | 21 | if test $? = 1 ; |
22 | then | 22 | then |
23 | crustified=" $crustified $f" | 23 | crustified=" $crustified $f" |
24 | RET=1 | 24 | RET=1 |
25 | fi | 25 | fi |
26 | fi | 26 | fi |
27 | done | 27 | done |
28 | 28 | ||