From 19fcec84d8d7d21e796c7624e521b60d28ee21ed Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 20:45:59 +0200 Subject: Adding upstream version 16.2.11+ds. Signed-off-by: Daniel Baumann --- src/spdk/.githooks/pre-commit | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 src/spdk/.githooks/pre-commit (limited to 'src/spdk/.githooks/pre-commit') diff --git a/src/spdk/.githooks/pre-commit b/src/spdk/.githooks/pre-commit new file mode 100755 index 000000000..c0b461246 --- /dev/null +++ b/src/spdk/.githooks/pre-commit @@ -0,0 +1,28 @@ +#!/bin/sh +# +# Verify what is about to be committed. +# Called by "git commit" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message if +# it wants to stop the commit. + +rc=0 + +# Redirect output to stderr. +exec 1>&2 + +# If there are formatting errors, print the offending file names and fail. +if [ -x "./scripts/check_format.sh" ]; then + echo "Running check_format.sh ..." + "./scripts/check_format.sh" > check_format.log 2>&1 + rc=$? + if [ $rc -ne 0 ]; then + cat check_format.log + echo "" + echo "ERROR check_format.sh returned errors!" + echo "ERROR Fix the problem and use 'git add' to update your changes." + echo "ERROR See `pwd`/check_format.log for more information." + echo "" + fi +fi + +exit $rc -- cgit v1.2.3