diff --git a/tools/test-gitignore.sh b/tools/prepare-commit.sh similarity index 50% rename from tools/test-gitignore.sh rename to tools/prepare-commit.sh index ec44350fc49..837298da7c9 100644 --- a/tools/test-gitignore.sh +++ b/tools/prepare-commit.sh @@ -1,11 +1,19 @@ -# Add .gitignore file to empty test directories. +# Prepares a Commit +# +# - Adds .gitignore file to empty test directories. +# +# When Eclipse creates 'test' src folders they are sometimes empty. Empty +# folders are not committed to GIT. Because of this Eclipse would show errors +# when importing the projects. This script creates an empty '.gitignore' file +# inside each 'test' folder to solve this. +# +# See https://stackoverflow.com/questions/115983 # -# When Eclipse creates 'test' src folders they are sometimes empty. Empty -# folders are not committed to GIT. Because of this Eclipse would show errors -# when importing the projects. This script creates an empty '.gitignore' file -# inside each 'test' folder to solve this. +# - Resets .classpath files. # -# See https://stackoverflow.com/questions/115983 +# When Eclipse 'Build All' is called, all .classpath files are touched and +# unnecessarily marked as changed. Using this script those files are reset +# to origin. # for D in *; do if [ -d "${D}" ]; then @@ -33,6 +41,9 @@ for D in *; do echo "${D}/test/.gitignore -> missing" touch ${D}/test/.gitignore fi + + # restore .classpath file from develop branch + git checkout origin/develop ${D}/.classpath ;; esac fi