Insert a short check to always check for newer versions
in the tool directory of the pre-commit script
So far, only a warning is being generated, allowing the
developer to decide for him/herself
Change-Id: I6fce60e3de1d051757d0ed38eae8fdc94cec7662
Reviewed-on: https://code.wireshark.org/review/633
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
# If there are whitespace errors, print the offending file names and fail. (from git pre-commit.sample)
exec git diff-index --check --cached HEAD
+# Check for newer versions of the pre-commit script
+if [ ./.git/hooks/pre-commit -ot ./tools/pre-commit ] ; then
+ echo "Pre-commit hook script is outdated, please update!"
+fi
+
for FILE in `git diff-index --cached --name-only HEAD` ; do
#Exit immediately if a command exits with a non-zero status.
set -e