Pre-Commit Hook check to check for newer version

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>
This commit is contained in:
Roland Knall 2014-03-13 14:28:43 +01:00 committed by Alexis La Goutte
parent b5fae942da
commit 73618c8d1c
1 changed files with 5 additions and 0 deletions

View File

@ -11,6 +11,11 @@
# 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