#!/bin/bash
# Pre-commit hook: check staged C/H changes with checkpatch.pl.
# Install: cp misc/pre-commit misc/commit-msg .git/hooks/

toplevel=$(git rev-parse --show-toplevel)

if ! "$toplevel/misc/checkpatch.sh" staged; then
	echo "Coding style check failed. Please fix warnings or commit with \"--no-verify\"." >&2
	exit 1
fi
