diff --git a/scripts/prepare-commit.sh b/scripts/prepare-commit.sh index f16ff285fac..d1e1dfc634d 100755 --- a/scripts/prepare-commit.sh +++ b/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 :