Skip to content
Permalink
Browse files

prepare-commit.sh: remove executable bit from source files and exit s…

…uccessfully if nothing modified
  • Loading branch information
jef-n committed Nov 13, 2014
1 parent 9a2327c commit 9cb157a7e56c83623e307cef00d00fbbfa556b73
Showing with 14 additions and 9 deletions.
  1. +14 −9 scripts/prepare-commit.sh
@@ -48,7 +48,7 @@ fi

if [ -z "$MODIFIED" ]; then
echo nothing was modified
exit 1
exit 0
fi

# save original changes
@@ -67,12 +67,15 @@ ASTYLEDIFF=astyle.$REV.diff
for f in $MODIFIED; do
case "$f" in
src/core/spatialite/*|src/core/gps/qextserialport/*|src/plugins/dxf2shp_converter/dxflib/src/*|src/plugins/globe/osgEarthQt/*|src/plugins/globe/osgEarthUtil/*)
echo $f skipped
echo $f skipped
continue
;;

*.cpp|*.c|*.h|*.cxx|*.hxx|*.c++|*.h++|*.cc|*.hh|*.C|*.H)
;;
*.cpp|*.c|*.h|*.cxx|*.hxx|*.c++|*.h++|*.cc|*.hh|*.C|*.H)
if [ -x "$f" ]; then
chmod a-x "$f"
fi
;;

*.py)
perl -i.prepare -pe "s/[\t ]+$//;" $f
@@ -83,12 +86,12 @@ for f in $MODIFIED; do
continue
;;

*)
continue
;;
esac
*)
continue
;;
esac

m=$f.$REV.prepare
m=$f.$REV.prepare

cp $f $m
astyle.sh $f
@@ -111,3 +114,5 @@ else
fi

exit 0

# vim: set ts=8 noexpandtab :

0 comments on commit 9cb157a

Please sign in to comment.
You can’t perform that action at this time.