prepare-commit.sh: remove executable bit from source files and exit successfully if nothing modified

This commit is contained in:
Juergen E. Fischer 2014-11-13 10:00:48 +01:00
parent 9a2327cd8f
commit 9cb157a7e5

View File

@ -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 :