summaryrefslogtreecommitdiff
path: root/tools/pre-commit
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss.ws@gmail.com>2016-11-01 21:29:11 -0400
committerAnders Broman <a.broman58@gmail.com>2016-11-02 04:42:47 +0000
commit8a376d4cd35e1e00b4c1bbd30ad85c6eda0561f3 (patch)
treeadb60974e103042bd34c670d1b6d5f56e92f99f4 /tools/pre-commit
parente1454337df5cee341f7973fbd8c2d9cc8cba9586 (diff)
downloadwireshark-8a376d4cd35e1e00b4c1bbd30ad85c6eda0561f3.tar.gz
Validate the Diameter XML files in the pre-commit script.
Validation requires xmllint but will pass (with a complaint) if the committer does not have xmllint installed. Change-Id: I336a1c8ad8e1f98805a284d8c4736810b1a9c54e Reviewed-on: https://code.wireshark.org/review/18609 Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'tools/pre-commit')
-rwxr-xr-xtools/pre-commit6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/pre-commit b/tools/pre-commit
index 75269264b0..3d2b009e49 100755
--- a/tools/pre-commit
+++ b/tools/pre-commit
@@ -53,6 +53,7 @@ fi
exit_status=0
COMMIT_FILES=`git diff-index --cached --name-status ${COMMIT_ID} | grep -v "^D" | cut -f2 | grep "\.[ch]$"`
+DIAMETER_FILES=`git diff-index --cached --name-status ${COMMIT_ID} | grep -v "^D" | cut -f2 | grep diameter/`
# Path to filter script in the tools directory
filter_script=${PWD}/tools/pre-commit-ignore.py
@@ -91,6 +92,11 @@ for FILE in $CHECK_FILES; do
done
+if [ "x$DIAMETER_FILES" != x ]
+then
+ ./tools/validate-diameter-xml.sh > /dev/null || exit_status=1
+fi
+
# If there are whitespace errors, print the offending file names and fail. (from git pre-commit.sample)
git diff-index --check --cached ${COMMIT_ID} || exit_status=1