Skip to content

Commit

Permalink
prepare-commit.sh: remove executable bit from source files and exit s…
Browse files Browse the repository at this point in the history
…uccessfully if nothing modified
  • Loading branch information
jef-n committed Nov 13, 2014
1 parent 9a2327c commit 9cb157a
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions scripts/prepare-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ fi

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

# save original changes
Expand All @@ -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
Expand All @@ -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
Expand All @@ -111,3 +114,5 @@ else
fi

exit 0

# vim: set ts=8 noexpandtab :

0 comments on commit 9cb157a

Please sign in to comment.